I'm trying to add items to qgraphicsscene, and move them later. I am using QMainWindow and QFrames to organize content of window and I can add items, but can't move the items. In tutorials I have found authors use QDialog and QgraphicsView as the only widget. Is that what makes the difference ? QMainWindow does not pass mouse events to GraphicsView or QGraphicsScene ? Any help appreciated.
def _add_area(self):
item = QGraphicsRectItem(0, 0, 100, 100)
brush = QBrush()
brush.setStyle(Qt.Dense7Pattern)
brush.setColor(Qt.darkBlue)
item.setBrush(brush)
item.setFlag(QGraphicsItem.ItemIsMovable)
item.setFlag(QGraphicsItem.ItemIsSelectable)
self._scene.addItem(item)