diff options
author | Morten Sorvig <msorvig@trolltech.com> | 2009-09-03 10:19:11 (GMT) |
---|---|---|
committer | Morten Sorvig <msorvig@trolltech.com> | 2009-09-03 10:19:11 (GMT) |
commit | 75078d7b20155ba192b88ec54008e07d1ee44676 (patch) | |
tree | e170f474aaed28d2476dc2d134f3be27e76c3741 /src/gui/kernel/qwidget_win.cpp | |
parent | 0dcf114697309f3f23f9717b608fa2be1813fe94 (diff) | |
parent | f55a2e6b2b3d97e74c3368552a6fba412d86e0b9 (diff) | |
download | Qt-75078d7b20155ba192b88ec54008e07d1ee44676.zip Qt-75078d7b20155ba192b88ec54008e07d1ee44676.tar.gz Qt-75078d7b20155ba192b88ec54008e07d1ee44676.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/kernel/qwidget_win.cpp')
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 8e60fb3..0ec7e7e 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -2062,29 +2062,21 @@ void QWidgetPrivate::registerTouchWindow() void QWidgetPrivate::winSetupGestures() { Q_Q(QWidget); - if (!q) - return; - if (!q->isVisible()) + if (!q || !q->isVisible()) return; QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); - bool needh = false; - bool needv = false; - bool singleFingerPanEnabled = false; QApplicationPrivate::WidgetStandardGesturesMap::const_iterator it = qAppPriv->widgetGestures.find(q); if (it == qAppPriv->widgetGestures.end()) return; const QStandardGestures &gestures = it.value(); - WId winid = 0; + WId winid = q->effectiveWinId(); - if (QAbstractScrollArea *asa = qobject_cast<QAbstractScrollArea*>(q)) { - winid = asa->viewport()->internalWinId(); - if (!winid) { - QWidget *nativeParent = asa->viewport()->nativeParentWidget(); - if (!nativeParent) - return; - winid = nativeParent->internalWinId(); - } + bool needh = false; + bool needv = false; + bool singleFingerPanEnabled = false; + + if (QAbstractScrollArea *asa = qobject_cast<QAbstractScrollArea*>(q->parent())) { QScrollBar *hbar = asa->horizontalScrollBar(); QScrollBar *vbar = asa->verticalScrollBar(); Qt::ScrollBarPolicy hbarpolicy = asa->horizontalScrollBarPolicy(); @@ -2094,12 +2086,6 @@ void QWidgetPrivate::winSetupGestures() needv = (vbarpolicy == Qt::ScrollBarAlwaysOn || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum())); singleFingerPanEnabled = asa->d_func()->singleFingerPanEnabled; - } else { - winid = q->internalWinId(); - if (!winid) { - if (QWidget *nativeParent = q->nativeParentWidget()) - winid = nativeParent->internalWinId(); - } } if (winid && qAppPriv->SetGestureConfig) { GESTURECONFIG gc[3]; |