PDA

View Full Version : Custom Widgets in Desinger



qtoptus
10th April 2010, 08:12
I want to create a custom widget that I can place and use from the Qt Designer like other built-in widgets...Simply this widget is actually derived from QWidget class and has additional initialization properties. What's the best way to do it?

faldzip
10th April 2010, 09:58
Open Qt Assistant. In Contents tab choose:
1. Qt Designer -> Manual -> Creating Custom Widgets for Qt Designer
2. Qt Designer -> Examples -> Custom Widget Plugin Example

To read how to create custom widgets for Qt Designer.

borisbn
10th April 2010, 11:12
Creating and Using Components for Qt Designer (http://qt.nokia.com/doc/4.6/qtdesigner-components.html)

qtoptus
10th April 2010, 23:59
Gr8t! Simple and informative. Thanks.

qtoptus
11th April 2010, 08:45
Oh one more thing...After I had successfully created a custom widget which I can now use from the Designer, it's still missing the boundaries (dashed outline) that indicates the widget placement and size...I use the analog clock example as a template, did not modify anything in the plygin module. Is there anything I need to do to show a guiding outline?

Thnx

faldzip
11th April 2010, 13:17
If you mean that your widget size is 0 in width or height, then implement sizeHint() in your widget.

qtoptus
11th April 2010, 18:47
Actually I mean the boundary outline that shows the widget in the designer forms...