ByForeward
16th September 2015, 15:18
Hi
Widget Promotion
Based on several forums I managed to promote a graphicsView accordingly.
The issue comes when within the promoted class I need to create a QLabel (within the graphicsView) that itself needs to be promoted.
1. Promote Graphics View :) (through the designer)
2. Add QLabel Widget within graphicsView (programatically) :)
label= new QLabel();
label->setFixedSize(320, 320);
label->setText("Test Label");
proxy = myScene->addWidget(label);
proxy->setZValue(0);
3. try to promote the generated label (That is within the graphicsView) to another class in code
Since i only have access to the label in the code and not via the designer. :confused:
How do I promote a QLabel to a specified class within code? (Not through the designer)
Your assistance is appreciated
Regards
Widget Promotion
Based on several forums I managed to promote a graphicsView accordingly.
The issue comes when within the promoted class I need to create a QLabel (within the graphicsView) that itself needs to be promoted.
1. Promote Graphics View :) (through the designer)
2. Add QLabel Widget within graphicsView (programatically) :)
label= new QLabel();
label->setFixedSize(320, 320);
label->setText("Test Label");
proxy = myScene->addWidget(label);
proxy->setZValue(0);
3. try to promote the generated label (That is within the graphicsView) to another class in code
Since i only have access to the label in the code and not via the designer. :confused:
How do I promote a QLabel to a specified class within code? (Not through the designer)
Your assistance is appreciated
Regards