[Qt-interest] Custom properties in designer
Michael Leupold
lemma at confuego.org
Thu Jul 30 14:12:01 CEST 2009
Andre Haupt wrote:
> On Thu, Jul 30, 2009 at 12:50:12PM +0200, Michael Leupold wrote:
>> I was looking for ways to make designer display and edit custom
>> (UserType) properties on custom widgets. Unfortunately it seems there
>> isn't a way to do it yet.
>
> What makes you think so? You might want to search the Qt docs for
> "Creating custom widgets for Qt Designer".
I didn't refer to simply adding custom widgets but to providing additional
editable property types.
Something along the lines of this:
class MyPropertyType
{
[...]
};
Q_DECLARE_METATYPE(MyPropertyType)
class MyWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(MyPropertyType myProp READ myProp WRITE setMyProp)
[...]
};
While I can make MyWidget available is designer I didn't find a way to make
myProp visible/editable.
Regards,
Michael
More information about the Qt-interest-old
mailing list