Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.0
-
None
-
Windows 7 32bit
Description
Steps to Recreate:
1) Have 2 states s1 and s2
2) Set transition from s1 to s2 using mouse release message on QGraphicsView as follows
QMouseEventTransition* tMouse = new QMouseEventTransition( m_ui->graphicsView, QEvent::MouseButtonRelease, Qt::LeftButton, s1);
tMouse->setTargetState( s2);
Result: s2 will never be entered. If you use mouse "press" message, it works well.
I stepped into the code and found that in QGraphicsView::mousePressEvent, after spontaneous of event, you have the code:
// Update the original mouse event accepted state.
bool isAccepted = mouseEvent.isAccepted();
event->setAccepted(isAccepted);
"isAccepted" is false here and the message can be passed to State Machine.
But in mouseReleaseEvent, the original mouse event accepted state is not updated and the State Machine will never get the chance to handle the mouse release event.