How to enable drag and drop in QGraphicsScene?

I am trying to put two photos in a QGraphicsScene . One is fixed and the other is movable. But I can only put these photos in QGraphicsScene , I can not move them. How can I achieve this?

+4
source share
1 answer

You must make sure that the element is movable. Take a look at QGraphicsItem :: setFlag .

You will need to do something like this:

 myImageItem->setFlag(QGraphicsItem::ItemIsMovable, true); 
+7
source

Source: https://habr.com/ru/post/1313083/


All Articles