How to bind QGraphicsWidget / Item (make them static) in QGraphicsView

I want to do something like hada. I have a QGraphicsScene with a huge QPixmap , which I added to the much smaller QGraphicsView . Now I need to add some controls, such as QLabel , QPushButton and QGraphicsEllipseItem . This, I think, is not a problem. I found this useful Graphics View Classes page. But how can I bind these controls to the view, or maybe itโ€™s better to say how I donโ€™t bind them? When I drag and drop a QPixmap , then I do not want the QPixmap to move with the QPixmap from QGraphicsView . What do I need to do to solve this problem. Hope someone can help me.

+1
qt qt4 pyqt qgraphicsview qgraphicsitem
source share
1 answer

You just need to create your widgets and specify a QGraphicsView in the constructor, like this:

 QPushButton *button1 = new QPushButton(view); 
+4
source share

All Articles