There is no such thing as widget promotion in code.
Widget promotion, in the context of Designer, is the mechanism by which the user can add a widget of some class C in design mode and make Designer, in the generated code setting up this UI, actually instantiate a specified subclass of C. E.g. if you have a QLabel-derived class MyLabel, you can add a QLabel in design mode and promote it to MyLabel. You will be limited, in design mode, to the QLabel interface (properties, signals), but Designer will generate code that instantiates a MyLabel and sets its QLabel-inherited properties accordingly.
If you write the code directly, just instantiate the correct class. Instead of
QLabel *label = new QLabel();
To copy to clipboard, switch view to plain text mode
, do something like
MyLabel *label = new MyLabel();
MyLabel *label = new MyLabel();
To copy to clipboard, switch view to plain text mode
Bookmarks