View Full Version : Property editor doesn't display my custom widget properties

16th May 2006, 19:15

I have created a custom widget and a plugin for it, so it shows up fine in designer. I have also added a couple of properties using the Q_PROPERTY macro. The problem is that these properties do not show up in the property editor when I click on my custom widget in designer. I am using Qt 4.1.2 on linux. Does anyone know how I can make the properties show up in the property editor?


16th May 2006, 19:55
Maybe your property handling methods are incorrect? Did you receive any warnings about it during plugin compilation?

16th May 2006, 20:09
No warnings. In fact, the property handling methods (and the properties themselves) are as simple as this:

Q_PROPERTY(int minimum READ minimum WRITE set_minimum)
Q_PROPERTY(int maximum READ maximum WRITE set_maximum)

int minimum() const;
int maximum() const;

void set_minimum(int min);
void set_maximum(int max);


16th May 2006, 20:14
Do you have Q_OBJECT macro inside your widget definition?

16th May 2006, 20:18
Yes, the Q_OBJECT is in there. Would you like me to post the sources?

16th May 2006, 20:38
OK, here's the (silly) thing I was doing:

I had a previous version of the shared library containing the custom widget that I did not remove from the $QTDIR/plugins/designer directory. I didn't want to lose it, so I just renamed it (Duh!!). I guess designer was loading my plugin from that old ".so" and was ignoring the new one that contained the properties.

Sorry for the confusion and thanks for the replies.