summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2013-11-05 11:47:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-07 10:00:19 +0100
commita94f61063a031444849fb0873f9b267a4f828597 (patch)
tree395b14b127bfc57711f18048898fcf70bb0c345c /src/plugins/platforms/qnx
parent96d74313fe722ed55f67a89633033ed49c3dc3a7 (diff)
QNX: Fixed "normalPosition" of touch events
Pixel positions have to be set in relation to screen size in pixels, not the physical size to calculate the normal position in the range 0..1. Change-Id: I6880fb64b7c3049d657fd081b564b945399b5865 Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
index e0dd20c40c..9db62865bb 100644
--- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
@@ -432,10 +432,12 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType)
if (w) {
// get size of screen which contains window
QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w);
- QSizeF screenSize = platformScreen->physicalSize();
+ QSizeF screenSize = platformScreen->geometry().size();
// update cached position of current touch point
- m_touchPoints[touchId].normalPosition = QPointF( static_cast<qreal>(pos[0]) / screenSize.width(), static_cast<qreal>(pos[1]) / screenSize.height() );
+ m_touchPoints[touchId].normalPosition =
+ QPointF(static_cast<qreal>(pos[0]) / screenSize.width(),
+ static_cast<qreal>(pos[1]) / screenSize.height());
m_touchPoints[touchId].area = QRectF( pos[0], pos[1], 0.0, 0.0 );
// determine event type and update state of current touch point