summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-25 17:39:52 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-25 17:39:52 (GMT)
commit5a7223450d0ebd4eaa47f263005c6d1c2e142a76 (patch)
tree9970c8b78e0d5178fbf44bab0317212b2a8c7bdd /src/gui/kernel
parent77e5ced3e6b4c1c5ef05684de736bf4939dbe115 (diff)
parentd7d0aaf8bea4e6a5c4c0500a46417d7c788f489a (diff)
downloadQt-5a7223450d0ebd4eaa47f263005c6d1c2e142a76.zip
Qt-5a7223450d0ebd4eaa47f263005c6d1c2e142a76.tar.gz
Qt-5a7223450d0ebd4eaa47f263005c6d1c2e142a76.tar.bz2
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (22 commits) Fix compilation of qegl.cpp after the last merge Fix a race condition with QtDBus blocking for replies. QtDBus: Debug message update Removed DEPLOYMENT from demos/spectrum/spectrum.pro Install source for spectrum demo Fixed path for copying launcher script for spectrum demo My 4.6.3 changes. Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( ecee9d7244ce4f7e7acf723bcef535532780db5f ) Fixed an assert in QMenu Backport multitouch bug fixes to 4.6 tst_bic: Add the Qt 4.5 and 4.6 baselines for x86-64 Call eglTerminate() when the last QEglContext is destroyed to free mem. Removed double EINTR loop from nativeWrite and nativeRead. Fixed qsslkey test deployment for Symbian and fixed compiler warnings. Fixing the race condition in event dispatcher implementation on changes-4.6.3 updated Fixing the compile issue. Fixing the compile issue. Typo. Removed nearest test from qaudiodeviceinfo unit test. ...
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_p.h3
-rw-r--r--src/gui/kernel/qapplication_s60.cpp23
2 files changed, 19 insertions, 7 deletions
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 01abe54..e30b6be 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -581,7 +581,8 @@ public:
void _q_readRX71MultiTouchEvents();
#endif
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
+ int pressureSupported;
int maxTouchPressure;
QList<QTouchEvent::TouchPoint> appAllTouchPoints;
#endif
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index fa07b1a..dc8d8f7 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -408,15 +408,22 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons
void QSymbianControl::translateAdvancedPointerEvent(const TAdvancedPointerEvent *event)
{
QApplicationPrivate *d = QApplicationPrivate::instance();
+ qreal pressure;
+ if(d->pressureSupported
+ && event->Pressure() > 0) //workaround for misconfigured HAL
+ pressure = event->Pressure() / qreal(d->maxTouchPressure);
+ else
+ pressure = qreal(1.0);
QRect screenGeometry = qApp->desktop()->screenGeometry(qwidget);
- while (d->appAllTouchPoints.count() <= event->PointerNumber())
- d->appAllTouchPoints.append(QTouchEvent::TouchPoint(d->appAllTouchPoints.count()));
+ QList<QTouchEvent::TouchPoint> points = d->appAllTouchPoints;
+ while (points.count() <= event->PointerNumber())
+ points.append(QTouchEvent::TouchPoint(points.count()));
Qt::TouchPointStates allStates = 0;
- for (int i = 0; i < d->appAllTouchPoints.count(); ++i) {
- QTouchEvent::TouchPoint &touchPoint = d->appAllTouchPoints[i];
+ for (int i = 0; i < points.count(); ++i) {
+ QTouchEvent::TouchPoint &touchPoint = points[i];
if (touchPoint.id() == event->PointerNumber()) {
Qt::TouchPointStates state;
@@ -446,7 +453,7 @@ void QSymbianControl::translateAdvancedPointerEvent(const TAdvancedPointerEvent
touchPoint.setNormalizedPos(QPointF(screenPos.x() / screenGeometry.width(),
screenPos.y() / screenGeometry.height()));
- touchPoint.setPressure(event->Pressure() / qreal(d->maxTouchPressure));
+ touchPoint.setPressure(pressure);
} else if (touchPoint.state() != Qt::TouchPointReleased) {
// all other active touch points should be marked as stationary
touchPoint.setState(Qt::TouchPointStationary);
@@ -458,11 +465,13 @@ void QSymbianControl::translateAdvancedPointerEvent(const TAdvancedPointerEvent
if ((allStates & Qt::TouchPointStateMask) == Qt::TouchPointReleased) {
// all touch points released
d->appAllTouchPoints.clear();
+ } else {
+ d->appAllTouchPoints = points;
}
QApplicationPrivate::translateRawTouchEvent(qwidget,
QTouchEvent::TouchScreen,
- d->appAllTouchPoints);
+ points);
}
#endif
@@ -1983,6 +1992,8 @@ TUint QApplicationPrivate::resolveS60ScanCode(TInt scanCode, TUint keysym)
void QApplicationPrivate::initializeMultitouch_sys()
{
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+ if (HAL::Get(HALData::EPointer3DPressureSupported, pressureSupported) != KErrNone)
+ pressureSupported = 0;
if (HAL::Get(HALData::EPointer3DMaxPressure, maxTouchPressure) != KErrNone)
maxTouchPressure = KMaxTInt;
#endif