don't mess with cursor pos if mouse outside view

Change-Id: I9dde440b4644c5bddcbe20f6f7458b588d076fdc
This commit is contained in:
Marco Martin 2014-10-24 11:50:44 +02:00
parent 4a4e3dc526
commit 8d2aa05530

View File

@ -1025,7 +1025,9 @@ bool Dialog::event(QEvent *event)
case QEvent::MouseButtonRelease: {
QMouseEvent *me = static_cast<QMouseEvent *>(event);
if (!d->mainItemContainsPosition(me->windowPos())) {
//don't mess with position if the cursor is actually outside the view:
//somebody is doing a click and drag that must not break when the cursor i outside
if (geometry().contains(me->screenPos().toPoint()) && !d->mainItemContainsPosition(me->windowPos())) {
QMouseEvent me2(me->type(),
d->positionAdjustedForMainItem(me->windowPos()),
d->positionAdjustedForMainItem(me->windowPos()),