• 11768阅读
  • 11回复

如何将custom widgets加到QT designer里 [复制链接]

上一主题 下一主题
离线xinchen
 
只看楼主 倒序阅读 楼主  发表于: 2009-01-09
— 本帖被 XChinux 执行加亮操作(2009-01-14) —
看了C++ GUI Programming with Qt 4, Second Edition第五章第四节的例子创建了一个Iconeditor custom widget,并且在安装目录下的plugins/designer 目录里生成了iconeditorplugin.dll、iconeditorplugin.exp、iconeditorplugin.ilk、iconeditorplugin.lib和iconeditorplugin.pdb五个文件,想把它加到QT designer
在网上搜了一下,说是这样做

http://doc.trolltech.com/3.3/designer-manual-7.html

Adding the Custom Widget to Qt Designer
Click Tools|Custom|Edit Custom Widgets to invoke the Edit Custom Widgets dialog.

1.Click New Widget so that we are ready to add our new widget.

2.Change the Class name from 'MyCustomWidget' to 'Vcr'.

3.Click the ellipsis (...) button to the right of the Headerfile line edit to invoke the file Open dialog. Locate vcr.h, select it, and click Open. It will now appear as the header file.

4.If you have a pixmap that you want to use to identify your widget on the toolbar click the ellipsis button to the right of Pixmap property. (The ellipsis button appears when you click in the Value part of the Properties list by a pixmap or iconSet property.)

In our example we have the file qt/tools/designer/examples/vcr/play.xpm which we'll use for this purpose.

5.Since we know the minimum sensible size for our widget we'll put these values into the Size Hint spin boxes. Enter a width of 80 (in the left hand spin box), and a height of 20 (in the right hand spin box).

但这个的版本是3.3.7,我用的是4.4.3,找不到“Tools|Custom|Edit Custom Widgets ”

离线lazybone
只看该作者 1楼 发表于: 2009-01-09
我以为是做好了个控件拖过去了
离线dotle
只看该作者 2楼 发表于: 2009-01-09
放在designer就可以了啊
离线xinchen
只看该作者 3楼 发表于: 2009-01-09
引用第2楼dotle于2009-01-09 12:45发表的  :
放在designer就可以了啊


怎么用呢?只能通过代码还是可以像qt designer其他控件一样?
离线wd007

只看该作者 4楼 发表于: 2009-01-10
自定义一个插件,然后将它放到安装qt designer 目录下plugin目录下
欢迎访问我的博客,一起学习提高
http://blog.csdn.net/qter_wd007
离线xinchen
只看该作者 5楼 发表于: 2009-01-11
引用第4楼wd007于2009-01-10 09:10发表的  :
自定义一个插件,然后将它放到安装qt designer 目录下plugin目录下


但这样的话,我在qt designer的界面里也还是看不到啊!
怎么用呢?
离线xinchen
只看该作者 6楼 发表于: 2009-01-14
顶一下
离线wd007

只看该作者 7楼 发表于: 2009-01-17
在那本官方书中有说明阿,照着来试一试
欢迎访问我的博客,一起学习提高
http://blog.csdn.net/qter_wd007
离线sunnydream
只看该作者 8楼 发表于: 2009-05-07
我用的也找不到“Tools|Custom|Edit Custom Widgets ”
离线sunnydream
只看该作者 9楼 发表于: 2009-05-07
运行 qt designer 里会在窗口部件盒中出现自定义的widget
但是qt creator里就不会出现
离线nhonz
只看该作者 10楼 发表于: 2010-12-05
为什么qt creator里就不会出现自定义的widget?
要在qt creator显示自定义的widget能否通过什么设置显示出来?
离线0354030w

只看该作者 11楼 发表于: 2010-12-05
一直用代码,遇不到这个问题
快速回复
限100 字节
 
上一个 下一个