I have a main widget in Qt and this widget contains a QGraphicsView
and inside it QGraphicsScene
. In scene I add QGraphicsPixmapItem
s and QGraphicsTextItem
s. In main widget I handle QWidget::mouseDoubleClickEvent ( QMouseEvent * event )
, my items are all set flags with:
mItem->setFlag ( QGraphicsItem::ItemIsMovable );
mItem->setFlag ( QGraphicsItem::ItemIsSelectable );
mItem->setFlag ( QGraphicsItem::ItemIsFocusable);
Because I want to move items in scene and select them and also I want when double click occurs main widget handles that. When I double click onto QGraphicsTextItem
it enters to mouseDoubleClickEvent
in main widget, however when I double click to QGraphicsPixmap
item, it absorbs double click and does not send it to main widget. Also when ItemIsFocusable
flag is not set, QGraphicsTextItem
also does absorb the double click event. Why does it occur?.
I did not want to implement subclass of QGraphicsItem
s and wanted to use already defined methods. Here is a picture of what I do: