QtEmbedded 4.70 QGraphicsItemGroup Problem
Hi,
I am transitioning from Qt4.41 -> Qt4.70. This is working without problem on Qt4.4.1. I am having a problem with QT4.70 QGraphicsItemGroup. If I add my QGraphicsItem to the scene my mouse events are propagated to the QGraphicsItem. However if the QGraphicsItem is added to a QGraphicsItemGroup the mouse event doesn't get sent to the QGraphicsItem. The mouse event occurs in the QGraphicsView, but the item is not getting it. The item/group is visible. All non-grouped items seem to work OK.
Thank you for any suggestions.
Re: QtEmbedded 4.70 QGraphicsItemGroup Problem
Hi,
I solved this problem by re-implementing QGraphicsItem::sceneEvent(QEvent *event). Now the mousepress/release events are occurring in the custom item.
Code:
bool MyCustomItem
::sceneEvent(QEvent *event
) {
switch (event->type()) {
case QEvent::GraphicsSceneMousePress: mousePressEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
break;
case QEvent::GraphicsSceneMouseRelease: mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
break;
default:
}
return true;
}
Re: QtEmbedded 4.70 QGraphicsItemGroup Problem
Hi.
Just so you know I have submitted this as a bug at Qt and it will be patched in 4.72
http://bugreports.qt.nokia.com/browse/QTBUG-15477