How to raise a QWidget over QGraphicsObjects in a QGraphicsScene
Hi,
I'm using a QGraphicsScene with several QGraphicsObjects of different zValue.
Now I have made a Control Widget (a few QPushbuttons and QComboBoxes and Layouts on a QWidget) with QCreator and added it to the
The problem is: the widget is being overlapped by most of the other objects in the scene.
I tried the QWidget::raise(); method to no avail at all. Is there any way to make QWidget appear in front of all QGraphicsScene members?
I cannot ensure that the widget is addet as last member to the scene.
I am running out of ideas :-( Any help is welcome, thank you for reading!
Sebastian
Re: How to raise a QWidget over QGraphicsObjects in a QGraphicsScene
Try giving your controlWidget a zValue higher than your other items:
Code:
QGraphicsProxyWidget *proxyWidget = scene()->addWidget(controlWidget);
proxyWidget->setZValue(1000); // or 10000 or . . .
Re: How to raise a QWidget over QGraphicsObjects in a QGraphicsScene
Norobro, thank you so much! My forehead aches big deal from being smashed on the table continuously for quite some time. "The very moment you do something the right way, it suddenly works". Like a charm. Thanks a ton! :)