View Full Version : Promoting a custom widget derived from QWidget Qt4

1st March 2006, 22:37

I think I am missing somthing about the widget promotion principal, and hope you can help me find what it is.
Promoting does nothing more then to put the right include line and the right constructor in the auto generated code.
What I don't understand is, why the trolls didn't make this mechanism to be available for the rest widgets that are not in designer, such as QStatusBar QScrollArea etc.
I actually didn't know there was such a restriction, and thought I could just use the promotion mechanism to nicely design my GUI with designer with a scroll area.
And it works!
I just used a QFrame in designer and promoted it to a "custom widget" named QScrollArea, that has the QScrollArea (h) file.
I guess the trolls just missed the QScrollArea in their class list that designer checks agaist, since when I tried to do the same with QStatusBar, designer gave me a message, that this class already axist, and I can't promot to it.
I wonder why the trolls use this policy...
For simple GUIs its no problem to add widgets in code, but if you can add only some widgets in designer, but not all, this can be quite a job to fit in code widgets in to complex designer designed froms that contain several (somtimes nested) layouts...

Any thoughts on this?

2nd March 2006, 18:50
I wonder what does the fact no one answer this means...;)
Any way, I just made a QStatusBar plugin, so I can use it in designer.
Feel free to use it, hope it will be usefull.