micky
24th April 2012, 23:01
Hi,
I want to enhance some standard Elements (like QLineEdit, QLabel, QListWidget) with a set of additional properties. So I created a Base class with the additional functionality and defined my new widgets as follows:
class myBase {
enum myAttrib { attribA = 1, AttribB = 2, AttribC = 4};
...
};
class myQLabel : public QLabel, public myBase {
Q_OBJECT
...
};
How can I get 'myAttrib' shown in the QtDesigner property editor of my new widget myQLabel? I tried to inherit myBase form QObject which I think is the right way to do, but then myQLabel depends on two classes of type QObject, which isn't supported.
I can put myAttrib into myQLabel (which works) but there must be a better solution.
I've also tried to use the domXML()-funktion to definen the Flag-property (with the 'set' datatyp-element), but QtDesigner ignored it silently.
Any hints?
Thanks a lot
I want to enhance some standard Elements (like QLineEdit, QLabel, QListWidget) with a set of additional properties. So I created a Base class with the additional functionality and defined my new widgets as follows:
class myBase {
enum myAttrib { attribA = 1, AttribB = 2, AttribC = 4};
...
};
class myQLabel : public QLabel, public myBase {
Q_OBJECT
...
};
How can I get 'myAttrib' shown in the QtDesigner property editor of my new widget myQLabel? I tried to inherit myBase form QObject which I think is the right way to do, but then myQLabel depends on two classes of type QObject, which isn't supported.
I can put myAttrib into myQLabel (which works) but there must be a better solution.
I've also tried to use the domXML()-funktion to definen the Flag-property (with the 'set' datatyp-element), but QtDesigner ignored it silently.
Any hints?
Thanks a lot