diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-14 08:55:04 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-18 13:21:25 (GMT) |
commit | ac8e33994455200c369d8aa9d1853b618c225058 (patch) | |
tree | e46879fd41c7bdcefc41b6f0ba25c7f0703623f3 /src/gui/kernel/qwidget.cpp | |
parent | 8f1724f5b3b09f57e260518f644ebc002b065443 (diff) | |
download | Qt-ac8e33994455200c369d8aa9d1853b618c225058.zip Qt-ac8e33994455200c369d8aa9d1853b618c225058.tar.gz Qt-ac8e33994455200c369d8aa9d1853b618c225058.tar.bz2 |
implemented gestures support in graphicsview for QGraphicsItems and
QGraphicsProxyWidgets.
This is still work-in-progress.
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 3a146e5..7920139 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -10970,7 +10970,10 @@ QWindowSurface *QWidget::windowSurface() const int QWidget::grabGesture(const QString &gesture) { Q_D(QWidget); - return d->grabGesture(QGestureManager::instance()->makeGestureId(gesture)); + int id = d->grabGesture(QGestureManager::instance()->makeGestureId(gesture)); + if (d->extra && d->extra->proxyWidget) + d->extra->proxyWidget->QGraphicsItem::d_ptr->grabGesture(id); + return id; } int QWidgetPrivate::grabGesture(int gestureId) @@ -10993,6 +10996,18 @@ bool QWidgetPrivate::releaseGesture(int gestureId) return false; } +bool QWidgetPrivate::hasGesture(const QString &name) const +{ + QGestureManager *gm = QGestureManager::instance(); + QSet<int>::const_iterator it = gestures.begin(), + e = gestures.end(); + for (; it != e; ++it) { + if (gm->gestureNameFromId(*it) == name) + return true; + } + return false; +} + /*! \since 4.6 @@ -11018,8 +11033,11 @@ int QWidget::grabGesture(Qt::GestureType gesture) void QWidget::releaseGesture(int gestureId) { Q_D(QWidget); - if (d->releaseGesture(gestureId)) + if (d->releaseGesture(gestureId)) { + if (d->extra && d->extra->proxyWidget) + d->extra->proxyWidget->QGraphicsItem::d_ptr->releaseGesture(gestureId); QGestureManager::instance()->releaseGestureId(gestureId); + } } /*! |