summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-01 09:10:53 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-03 09:30:54 (GMT)
commita1a0ea71d8861e2b794f2f9b55447d50fc520de3 (patch)
tree4501c80ddb47c3dbe9526c16f8ede26716054a54 /src/gui/widgets
parent0d5b6dccf5fa854632e61971364629b36e0d3857 (diff)
downloadQt-a1a0ea71d8861e2b794f2f9b55447d50fc520de3.zip
Qt-a1a0ea71d8861e2b794f2f9b55447d50fc520de3.tar.gz
Qt-a1a0ea71d8861e2b794f2f9b55447d50fc520de3.tar.bz2
Improved the gesture api.
Added a new widget attribute Qt::WA_DontUseStandardGestures that disables all implicit gestures (i.e. gestures that are automatically enabled by Qt itself). This change also changes the way gestures are handled on QAbstractScrollArea-based widgets on Windows - the gestures are supposed to be created on the viewport widget. Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp6
-rw-r--r--src/gui/widgets/qplaintextedit.cpp4
-rw-r--r--src/gui/widgets/qplaintextedit_p.h1
-rw-r--r--src/gui/widgets/qtextedit.cpp2
4 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 770e769..6de7c10 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -54,6 +54,7 @@
#ifdef Q_WS_WIN
#include "qstandardgestures.h"
+#include <private/qstandardgestures_p.h>
#endif
#include "qabstractscrollarea_p.h"
@@ -299,8 +300,11 @@ void QAbstractScrollAreaPrivate::init()
layoutChildren();
#ifdef Q_WS_WIN
- panGesture = new QPanGesture(viewport);
+ panGesture = new QPanGesture(viewport, q);
+ panGesture->d_func()->implicitGesture = true;
+ QObject::connect(panGesture, SIGNAL(started()), q, SLOT(_q_gestureTriggered()));
QObject::connect(panGesture, SIGNAL(triggered()), q, SLOT(_q_gestureTriggered()));
+ QObject::connect(panGesture, SIGNAL(finished()), q, SLOT(_q_gestureTriggered()));
#endif // Q_WS_WIN
}
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index c79e482..085341c 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -794,10 +794,6 @@ 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)
diff --git a/src/gui/widgets/qplaintextedit_p.h b/src/gui/widgets/qplaintextedit_p.h
index 7ff0c03..cda1d92 100644
--- a/src/gui/widgets/qplaintextedit_p.h
+++ b/src/gui/widgets/qplaintextedit_p.h
@@ -182,7 +182,6 @@ public:
#ifdef Q_WS_WIN
void _q_gestureTriggered();
- QPanGesture *panGesture;
#endif
};
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 547a4fb..cc79464 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -67,8 +67,6 @@
#include <qtexttable.h>
#include <qvariant.h>
-#include <qstandardgestures.h>
-
#include <qinputcontext.h>
#endif