PDA

View Full Version : Inherited Properties on Custom Widgets



mbreier
26th April 2010, 16:28
Hello All,

I have built my own Label Widget derived from QLabel which is now clickable. It is working fine and also shown in QTDesigner and also in QTCreator without Problems. I have used Qt 4.6.2. I also tried to bring it visible inside Eclipse integration but I failed and gave up. But thats another storie.
When I place my new Label on a Form inside QtDesigner I can see the properties for QObject and QWidget in the Property Editor. Thats fine, but what about the QFrame and the QLabel properties. If I place a normal QLabel on my Form the inherited properties are also shown in the property editor. I gues I have to adopt the domXml Function but I'm not sure.

Thanks
Michael

jpn
27th April 2010, 17:52
Hmm, I have a feeling that it's not domXml() because for example QxtLineEdit plugin works fine and the domXml() implementation is trivial one liner telling nothing about the base class: http://dev.libqxt.org/libqxt/src/tip/src/designer/qxtlineeditplugin.cpp. But do you have appropriate Q_OBJECT macros there?

mbreier
28th April 2010, 08:00
Hello, and thanx for the answer.

Yes I have also seen that the Qt3 support widgets also showing the properties of their base classes and the domXml is also very simple.
Yes I think I have all the QT macros used which are also described in the QtAssistent examples.

The code for the plugin can be downloaded here:

http://www.isd-web.com/index.php?option=com_rokdownloads&view=folder&Itemid=23

Its the MyLabel.cpp.tar.gz download.

Thanks
Michael

mbreier
30th April 2010, 08:30
Hi again,

I checked the Qxt lib but couldnt find the differences in the QxtLabel. The only difference was that QxtLabel inherits from QFrame.
I tried this but didn't chnaged anything.
Any other Ideas?
Thanks
Michael