Commit d845053c authored by Jan Möbius's avatar Jan Möbius

Dennis:

 Catch all mouse events.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6803 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 09259380
......@@ -178,8 +178,6 @@ glViewer* QtGLGraphicsScene::findView (const QPointF &_p, bool _setActive)
void QtGLGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent* _e)
{
if (cursorPainter_)
cursorPainter_->updateCursorPosition (_e->scenePos ());
QGraphicsScene::mouseMoveEvent(_e);
if (_e->isAccepted())
return;
......@@ -189,8 +187,6 @@ void QtGLGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent* _e)
return;
v->mouseMoveEvent(_e);
update ();
}
//-----------------------------------------------------------------------------
......@@ -213,6 +209,13 @@ bool QtGLGraphicsScene::event(QEvent *_event)
cursorPainter_->setMouseIn (false);
update ();
}
else if (cursorPainter_ && _event->type() == QEvent::GraphicsSceneMouseMove)
{
QGraphicsSceneMouseEvent *e = static_cast<QGraphicsSceneMouseEvent*>(_event);
cursorPainter_->updateCursorPosition (e->scenePos ());
update ();
}
return QGraphicsScene::event (_event);
}
......
......@@ -127,16 +127,12 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re
void SimpleGLGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent* _e)
{
cursorPainter_->updateCursorPosition (_e->scenePos ());
QGraphicsScene::mouseMoveEvent(_e);
if (_e->isAccepted())
return;
if (view_)
view_->mouseMoveEvent(_e);
update ();
}
void SimpleGLGraphicsScene::setView(glViewer * _view)
......@@ -158,6 +154,12 @@ bool SimpleGLGraphicsScene::event(QEvent *_event)
cursorPainter_->setMouseIn (false);
update ();
}
else if (cursorPainter_ && _event->type() == QEvent::GraphicsSceneMouseMove)
{
QGraphicsSceneMouseEvent *e = static_cast<QGraphicsSceneMouseEvent*>(_event);
cursorPainter_->updateCursorPosition (e->scenePos ());
update ();
}
return QGraphicsScene::event (_event);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment