summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-08-11 16:23:10 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-25 02:23:25 +0100
commit0fb5c7e71d6f9551b5e60f42a0d210ee65b01595 (patch)
tree2049c3884f7134938b0af95c83c15d2beda26301 /src/widgets
parente30fdcf683ba1270ce9fcd487a08bca452d04af3 (diff)
Make coordinates float based where it makes sense.
Mouse and Hover events already use FP corrdinates. They also make sense for tablet and drop events. Task-number: QTBUG-20115 Change-Id: Iff35d1f468567bd5a37236853dbc7725a37d87f2 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qapplication.cpp10
-rw-r--r--src/widgets/statemachine/qguistatemachine.cpp6
2 files changed, 6 insertions, 10 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 1f76bcdc04..627b444014 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3700,11 +3700,11 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
{
QWidget *w = static_cast<QWidget *>(receiver);
QTabletEvent *tablet = static_cast<QTabletEvent*>(e);
- QPoint relpos = tablet->pos();
+ QPointF relpos = tablet->posF();
bool eventAccepted = tablet->isAccepted();
while (w) {
- QTabletEvent te(tablet->type(), relpos, tablet->globalPos(),
- tablet->hiResGlobalPos(), tablet->device(), tablet->pointerType(),
+ QTabletEvent te(tablet->type(), relpos, tablet->globalPosF(),
+ tablet->device(), tablet->pointerType(),
tablet->pressure(), tablet->xTilt(), tablet->yTilt(),
tablet->tangentialPressure(), tablet->rotation(), tablet->z(),
tablet->modifiers(), tablet->uniqueId());
@@ -3799,7 +3799,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
if (w->isWindow())
break;
- dragEvent->p = w->mapToParent(dragEvent->p);
+ dragEvent->p = w->mapToParent(dragEvent->p.toPoint());
w = w->parentWidget();
}
}
@@ -3838,7 +3838,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QDropEvent *dragEvent = static_cast<QDropEvent *>(e);
QWidget *origReciver = static_cast<QWidget *>(receiver);
while (origReciver && w != origReciver) {
- dragEvent->p = origReciver->mapToParent(dragEvent->p);
+ dragEvent->p = origReciver->mapToParent(dragEvent->p.toPoint());
origReciver = origReciver->parentWidget();
}
}
diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp
index 1eaf6908c2..122730b2ba 100644
--- a/src/widgets/statemachine/qguistatemachine.cpp
+++ b/src/widgets/statemachine/qguistatemachine.cpp
@@ -183,10 +183,6 @@ static QEvent *cloneEvent(QEvent *e)
return new QInputMethodEvent(*static_cast<QInputMethodEvent*>(e));
case QEvent::AccessibilityPrepare:
return new QEvent(*e);
-#ifndef QT_NO_TABLETEVENT
- case QEvent::TabletMove:
- return new QTabletEvent(*static_cast<QTabletEvent*>(e));
-#endif //QT_NO_TABLETEVENT
case QEvent::LocaleChange:
return new QEvent(*e);
case QEvent::LanguageChange:
@@ -196,8 +192,8 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::Style:
return new QEvent(*e);
#ifndef QT_NO_TABLETEVENT
+ case QEvent::TabletMove:
case QEvent::TabletPress:
- return new QTabletEvent(*static_cast<QTabletEvent*>(e));
case QEvent::TabletRelease:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
#endif //QT_NO_TABLETEVENT