Property editor doesn't display my custom widget properties
Hello,
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?
Thanks,
Cristian
Re: Property editor doesn't display my custom widget properties
Maybe your property handling methods are incorrect? Did you receive any warnings about it during plugin compilation?
Re: Property editor doesn't display my custom widget properties
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);
Thanks,
Cristian
Re: Property editor doesn't display my custom widget properties
Do you have Q_OBJECT macro inside your widget definition?
Re: Property editor doesn't display my custom widget properties
Yes, the Q_OBJECT is in there. Would you like me to post the sources?
Re: Property editor doesn't display my custom widget properties
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.
Cristian