backgroundOrigin is a Q_ENUM() style. You set it usng the enum as property type.
The user can only use values in the fixed values proposed.
Ok, now we are getting somewhere ;-)
This is EXACTLY the thing I am trying to do - as I wrote in my original post.
I have declared a property which is a Q_ENUM() as well - but what I dont understand is, how do I make the enum value names apear in the designer ?
With other types I dont have this problem, since when you introduce a custom widegt to the designer, among other things, you need to specify its properties.
For that, the designer is offering a fixed list of types, which ofcourse do not have my enum (the only thing I can use instead is "int" type property which will expect an numerical input from the user).
So how do I bring my enum property in to the property list in designer for my custom widget, so that the enum values will be selectable like backgroundOrigin's?
In other words how do I get the GREY, RGB565, RGB32 ect, to be selectable values for the property videoMode in designer?
I hope I made my self clear enough....
I am attching the class decleration of my custom widget, to make things clear.
class QGrabber :public QWidget, public IhGrabber
{
Q_OBJECT
Q_ENUMS( VideoMode )
Q_PROPERTY( QString device READ getDevice WRITE setDevice )
Q_PROPERTY( int channel READ getChannel WRITE setChannel )
Q_PROPERTY( VideoMode videoMode READ getVideoMode WRITE setVideoMode )
public:
enum VideoMode { GREY=VIDEO_PALETTE_GREY , RGB565=VIDEO_PALETTE_RGB565, RGB24=VIDEO_PALETTE_RGB24, RGB32=VIDEO_PALETTE_RGB32 };
VideoMode videoMode;
QString device;
int channel;
int m_mode;
//.......
}
Thanks for your help!