diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-25 08:26:35 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-25 08:29:14 (GMT) |
commit | 042f15fefd19584c546cb55f24c4c79c4d76529c (patch) | |
tree | d18ae93811676588f0f77280fb4c7f93686d834f /src | |
parent | 1908002e9b7cbd9c3ebdec061e842bd6296b1edb (diff) | |
download | Qt-042f15fefd19584c546cb55f24c4c79c4d76529c.zip Qt-042f15fefd19584c546cb55f24c4c79c4d76529c.tar.gz Qt-042f15fefd19584c546cb55f24c4c79c4d76529c.tar.bz2 |
Carbon: pan gesture keeps breaking wheel events
Solution: remove pan gestures from all scroll areas in Qt. I do
this for Mac now, but I will strongly suggest that we do this
on Win as well, as there is currently no way to override the
panning behaviour, and this works against the intention of
scroll areas.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qabstractscrollarea.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qabstractscrollarea.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/qabstractscrollarea_p.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qplaintextedit.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/qplaintextedit.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/qplaintextedit_p.h | 6 |
6 files changed, 25 insertions, 3 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 28435ef..1b4d41b 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -51,7 +51,10 @@ #include "qdebug.h" #include "qboxlayout.h" #include "qpainter.h" + +#ifdef Q_WS_WIN #include "qstandardgestures.h" +#endif #include "qabstractscrollarea_p.h" #include <qwidget.h> @@ -1344,6 +1347,7 @@ void QAbstractScrollArea::setupViewport(QWidget *viewport) Q_UNUSED(viewport); } +#ifdef Q_WS_WIN void QAbstractScrollAreaPrivate::_q_gestureTriggered() { Q_Q(QAbstractScrollArea); @@ -1362,6 +1366,7 @@ void QAbstractScrollAreaPrivate::_q_gestureTriggered() vbar->setValue(newY); } } +#endif QT_END_NAMESPACE diff --git a/src/gui/widgets/qabstractscrollarea.h b/src/gui/widgets/qabstractscrollarea.h index 0a3e9c5..0625458 100644 --- a/src/gui/widgets/qabstractscrollarea.h +++ b/src/gui/widgets/qabstractscrollarea.h @@ -128,7 +128,10 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_hslide(int)) Q_PRIVATE_SLOT(d_func(), void _q_vslide(int)) Q_PRIVATE_SLOT(d_func(), void _q_showOrHideScrollBars()) + +#ifdef Q_WS_WIN Q_PRIVATE_SLOT(d_func(), void _q_gestureTriggered()) +#endif friend class QStyleSheetStyle; friend class QWidgetPrivate; diff --git a/src/gui/widgets/qabstractscrollarea_p.h b/src/gui/widgets/qabstractscrollarea_p.h index a5acdd1..4362ce9 100644 --- a/src/gui/widgets/qabstractscrollarea_p.h +++ b/src/gui/widgets/qabstractscrollarea_p.h @@ -101,9 +101,9 @@ public: { return q_func()->viewportEvent(event); } QScopedPointer<QObject> viewportFilter; - virtual void _q_gestureTriggered(); #ifdef Q_WS_WIN QPanGesture *panGesture; + virtual void _q_gestureTriggered(); bool singleFingerPanEnabled; void setSingleFingerPanEnabled(bool on = true); #endif diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index 03c36d7..e025876 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -66,7 +66,9 @@ #include <qtexttable.h> #include <qvariant.h> +#ifdef Q_WS_WIN #include <qstandardgestures.h> +#endif #include <qinputcontext.h> @@ -792,8 +794,10 @@ void QPlainTextEditPrivate::init(const QString &txt) viewport->setCursor(Qt::IBeamCursor); #endif originalOffsetY = 0; +#ifdef Q_WS_WIN panGesture = new QPanGesture(q); QObject::connect(panGesture, SIGNAL(triggered()), q, SLOT(_q_gestureTriggered())); +#endif } void QPlainTextEditPrivate::_q_repaintContents(const QRectF &contentsRect) @@ -2918,6 +2922,8 @@ QAbstractTextDocumentLayout::PaintContext QPlainTextEdit::getPaintContext() cons (\a available is true) or unavailable (\a available is false). */ +#ifdef Q_WS_WIN + void QPlainTextEditPrivate::_q_gestureTriggered() { Q_Q(QPlainTextEdit); @@ -2942,6 +2948,8 @@ void QPlainTextEditPrivate::_q_gestureTriggered() } } +#endif + QT_END_NAMESPACE #include "moc_qplaintextedit.cpp" diff --git a/src/gui/widgets/qplaintextedit.h b/src/gui/widgets/qplaintextedit.h index c9652ae..5ec3ed8 100644 --- a/src/gui/widgets/qplaintextedit.h +++ b/src/gui/widgets/qplaintextedit.h @@ -269,7 +269,11 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars()) Q_PRIVATE_SLOT(d_func(), void _q_verticalScrollbarActionTriggered(int)) Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged()) + +#ifdef Q_WS_WIN Q_PRIVATE_SLOT(d_func(), void _q_gestureTriggered()) +#endif + friend class QPlainTextEditControl; }; diff --git a/src/gui/widgets/qplaintextedit_p.h b/src/gui/widgets/qplaintextedit_p.h index 608f3cf..e93302c 100644 --- a/src/gui/widgets/qplaintextedit_p.h +++ b/src/gui/widgets/qplaintextedit_p.h @@ -176,12 +176,14 @@ public: #endif void _q_cursorPositionChanged(); - void _q_modificationChanged(bool); - void _q_gestureTriggered(); int originalOffsetY; + +#ifdef Q_WS_WIN + void _q_gestureTriggered(); QPanGesture *panGesture; +#endif }; QT_END_NAMESPACE |