Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
4.7.0, 4.7.1, 5.4.2
-
None
-
I am using Linux OS Centos 5.0 and cross-compiling for ARM cpu using GCC4.4.1 for compiling. I am using an embedded device with a touchscreen. Downloaded source code from LGPL-> Qt:Framework Only - 'Qt Libraries 4.7.1 for embedded Linux'
Tag ID
Source revision: 1b3f43c997b00d6b0d435ed8be08596c913a0189
Mkdist revision: 97dfb53c44c46871539dbc346e76d9983b6a7054I am using Linux OS Centos 5.0 and cross-compiling for ARM cpu using GCC4.4.1 for compiling. I am using an embedded device with a touchscreen. Downloaded source code from LGPL-> Qt:Framework Only - 'Qt Libraries 4.7.1 for embedded Linux' Tag ID Source revision: 1b3f43c997b00d6b0d435ed8be08596c913a0189 Mkdist revision: 97dfb53c44c46871539dbc346e76d9983b6a7054
Description
When adding a custom overrided QGraphicsItem to a QGraphicsItemGroup, the item's mousePressEvent(QGraphicsSceneMouseEvent *event) and void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) are not being executed. The QGraphicsScene is not propagating the event to the item. If the item is added to the scene it works but obviously the item is not treated as a group anymore. Note: I am currently using QT4.4.1 and this problem does not occur. I tried QT4.70 and QT4.71 and both exhibit this problem. I am in the processing of transistioning from QT4.4.1 to QT4.7X and I noticed this problem.
Reproduce this with the attached source , add the item to the group, then add the group to the scene, then you will not see the debug mousepressevent() mousereleaseevent() in the Item. ( The View is receiving the mouse event and same with the scene, the scene is sending the event to the item but item is not receiving the event)
Please suggest a workaround if possible. My previous Qt4.4.1 version is commercial edition.
*EDIT*
Adding this to the item seems to work OK
bool GraphicsItem::sceneEvent(QEvent *event)
{
if (event->type() == QEvent::GraphicsSceneMousePress)
else if (event->type() == QEvent::GraphicsSceneMouseRelease)
{ mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event)); } event->setAccepted(true);
return true;
}