Unsolved QVBoxLayout over QLabel ?
-
Is there a way to display a QVBoxLayout which includes widgets as QPushbutton QCheckbox over a QLabel which inludes a QPixmap ?
-
Hi,
Do you want a widget with an image background ? If so, the simple way would be through a style sheet using
background-image
Hope it helps.
-
@SGaist Not really, sorry I wasn't clear enough.
I have a QLabel which displays a QPixmap. Over the QLabel(in the foreground / "at the top") I'd like to display a vertical layout(consisting of a button and a checkbox, if it matters).
-
Not sure I understand but...
QPushButton* pb = new QPushButton("foo"); QCheckBox* cb = new QCheckBox("bar"); QLabel* label = new QLabel(); label->setPixmap("bazz.png"); QVBoxLayout* lay = new QVBoxLayout(); lay->addWidget(pb); lay->addWidget(cb); lay->addWidget(label);
-
Since my mad paint skills are far better than my English, I'll try to express my wish trough a picture. As you can see, the QLabel is in the background and QVBoxLayout in the foreground. This is what I'm trying to achieve.
-
If I guess the goal of your application correctly, you should rather consider the Graphics View framework. A QGraphicsPixmapItem and a QGraphicsWidgetItem on top and you'll likely have less trouble implementing animations.