tags:

views:

467

answers:

1

I've got the following custom widget:

class QDESIGNER_WIDGET_EXPORT MySpecialButton : public QAbstractButton
{
    Q_OBJECT
    ...etc...
};

Qt Designer recognizes this widget, and I can place it onto my form without a problem. However, when looking in the property editor, only the QObject and QWidget properties are visible. How do I get Qt Designer to recognize that this is also a QAbstractButton object?

+1  A: 

First, make sure you have the Q_OBJECT macro in your class definition. Also, make sure the file was properly moced. If neither of those help, you might investigate how QPushButton and QToolButton are declared to see if that gives you any hints.

Finally, if you need a chainsaw approach rather than a scalpel, you could define the properties you want to set in your class, giving the QAbstractButton functions as the ones to call for the properties. Look into the Q_PROPERTY macro.

Caleb Huitt - cjhuitt
Thanks, but I've got the Q_OBJECT macro in there (edited my question for clarity). I was getting compiler errors until I fixed that.I've looked at QPushButton, and I didn't see anything special about it. I'm going to leave this question up for awhile, and if I never get a solution, I guess I'll go the chainsaw route.
mos