summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-08-11 06:39:12 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-09-23 13:10:39 (GMT)
commit5e11ae8dc8594f648105f8a62baf1b82c909fd2a (patch)
treee9e83d8f4d498fd02aa0b3fc8a788943bc7e0c1f /src
parent2e27c5a11488d5b7aa6831ba30a8c11bf71fb07a (diff)
downloadQt-5e11ae8dc8594f648105f8a62baf1b82c909fd2a.zip
Qt-5e11ae8dc8594f648105f8a62baf1b82c909fd2a.tar.gz
Qt-5e11ae8dc8594f648105f8a62baf1b82c909fd2a.tar.bz2
Implement Qt::WA_AcceptTouchEvents on S60
Turning this attribute ends up calling RWindow::EnabledAdvancedPointers(), which tells Symbian to send us multiple pointer events with extended info. Reviewed-by: Jason Barron
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/kernel/qwidget_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp12
3 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 6f5781c..53ef682 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -10397,7 +10397,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
case Qt::WA_AcceptTouchEvents:
-#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_S60)
if (on)
d->registerTouchWindow();
#endif
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 5a9c48c..296c5b1 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -693,6 +693,7 @@ public:
static QWidget *keyboardGrabber;
void s60UpdateIsOpaque();
void reparentChildren();
+ void registerTouchWindow();
#endif
};
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 4fef020..2e6139b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -299,6 +299,9 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
destroyw->ControlEnv()->AppUi()->RemoveFromStack(destroyw);
CBase::Delete(destroyw);
}
+
+ if (q->testAttribute(Qt::WA_AcceptTouchEvents))
+ registerTouchWindow();
}
@@ -800,6 +803,15 @@ void QWidgetPrivate::setMask_sys(const QRegion& /* region */)
}
+void QWidgetPrivate::registerTouchWindow()
+{
+ Q_Q(QWidget);
+ if (q->testAttribute(Qt::WA_WState_Created) && q->windowType() != Qt::Desktop) {
+ RWindow *rwindow = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
+ rwindow->EnableAdvancedPointers();
+ }
+}
+
int QWidget::metric(PaintDeviceMetric m) const
{
Q_D(const QWidget);