diff options
author | axis <qt-info@nokia.com> | 2009-08-21 13:23:42 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-08-21 13:23:42 (GMT) |
commit | 044680951401487590c0ed554092dd9b7e0ee783 (patch) | |
tree | ed2492ad2fd49481148fdd7a1486cbf197c9bfe7 /src/gui/kernel/qwidget_win.cpp | |
parent | ab1df6dea670a60bfef5efd81d6687f9534cfc5d (diff) | |
parent | 00ba962d428dcdff70fcde74a9e5cb316545cef6 (diff) | |
download | Qt-044680951401487590c0ed554092dd9b7e0ee783.zip Qt-044680951401487590c0ed554092dd9b7e0ee783.tar.gz Qt-044680951401487590c0ed554092dd9b7e0ee783.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
src/corelib/io/qprocess.h
Diffstat (limited to 'src/gui/kernel/qwidget_win.cpp')
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 3d618fe..4fc37b1 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -2070,11 +2070,21 @@ void QWidgetPrivate::winSetupGestures() bool needh = false; bool needv = false; bool singleFingerPanEnabled = false; - QStandardGestures gestures = qAppPriv->widgetGestures[q]; + QApplicationPrivate::WidgetStandardGesturesMap::const_iterator it = + qAppPriv->widgetGestures.find(q); + if (it == qAppPriv->widgetGestures.end()) + return; + const QStandardGestures &gestures = it.value(); WId winid = 0; if (QAbstractScrollArea *asa = qobject_cast<QAbstractScrollArea*>(q)) { - winid = asa->viewport()->winId(); + winid = asa->viewport()->internalWinId(); + if (!winid) { + QWidget *nativeParent = asa->viewport()->nativeParentWidget(); + if (!nativeParent) + return; + winid = nativeParent->internalWinId(); + } QScrollBar *hbar = asa->horizontalScrollBar(); QScrollBar *vbar = asa->verticalScrollBar(); Qt::ScrollBarPolicy hbarpolicy = asa->horizontalScrollBarPolicy(); @@ -2085,9 +2095,13 @@ void QWidgetPrivate::winSetupGestures() (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum())); singleFingerPanEnabled = asa->d_func()->singleFingerPanEnabled; } else { - winid = q->winId(); + winid = q->internalWinId(); + if (!winid) { + if (QWidget *nativeParent = q->nativeParentWidget()) + winid = nativeParent->internalWinId(); + } } - if (qAppPriv->SetGestureConfig) { + if (winid && qAppPriv->SetGestureConfig) { GESTURECONFIG gc[3]; memset(gc, 0, sizeof(gc)); gc[0].dwID = GID_PAN; @@ -2116,7 +2130,6 @@ void QWidgetPrivate::winSetupGestures() else gc[2].dwBlock = GC_ROTATE; - Q_ASSERT(winid); qAppPriv->SetGestureConfig(winid, 0, sizeof(gc)/sizeof(gc[0]), gc, sizeof(gc[0])); } } |