summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qplaintextedit.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-09 17:09:09 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-09 17:09:09 (GMT)
commitf2437d3aa6cc274b9e663801892fd4e40e693546 (patch)
tree7a5b1425ac403336eb77c80ca0a551e7222f60f8 /src/gui/widgets/qplaintextedit.cpp
parent7566a1f15ea32504c10d9467fb69a6399a06c325 (diff)
downloadQt-f2437d3aa6cc274b9e663801892fd4e40e693546.zip
Qt-f2437d3aa6cc274b9e663801892fd4e40e693546.tar.gz
Qt-f2437d3aa6cc274b9e663801892fd4e40e693546.tar.bz2
A new implementation of the Gesture API.
Implemented gestures using gesture events and separate QGesture/QGestureRecognizer classes. Reviewed-by: trustme
Diffstat (limited to 'src/gui/widgets/qplaintextedit.cpp')
-rw-r--r--src/gui/widgets/qplaintextedit.cpp55
1 files changed, 23 insertions, 32 deletions
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index 2ed6cd7..22438bf 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -65,11 +65,6 @@
#include <limits.h>
#include <qtexttable.h>
#include <qvariant.h>
-
-#ifdef Q_WS_WIN
-#include <qstandardgestures.h>
-#endif
-
#include <qinputcontext.h>
#ifndef QT_NO_TEXTEDIT
@@ -2937,33 +2932,29 @@ 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);
- QPanGesture *g = qobject_cast<QPanGesture*>(q->sender());
- if (!g)
- return;
- QScrollBar *hBar = q->horizontalScrollBar();
- QScrollBar *vBar = q->verticalScrollBar();
- if (g->state() == Qt::GestureStarted)
- originalOffsetY = vBar->value();
- QSizeF totalOffset = g->totalOffset();
- if (!totalOffset.isNull()) {
- if (QApplication::isRightToLeft())
- totalOffset.rwidth() *= -1;
- // QPlainTextEdit scrolls by lines only in vertical direction
- QFontMetrics fm(q->document()->defaultFont());
- int lineHeight = fm.height();
- int newX = hBar->value() - g->lastOffset().width();
- int newY = originalOffsetY - totalOffset.height()/lineHeight;
- hbar->setValue(newX);
- vbar->setValue(newY);
- }
-}
-
-#endif
+//void QPlainTextEditPrivate::_q_gestureTriggered()
+//{
+// Q_Q(QPlainTextEdit);
+// QPanGesture *g = qobject_cast<QPanGesture*>(q->sender());
+// if (!g)
+// return;
+// QScrollBar *hBar = q->horizontalScrollBar();
+// QScrollBar *vBar = q->verticalScrollBar();
+// if (g->state() == Qt::GestureStarted)
+// originalOffsetY = vBar->value();
+// QSizeF totalOffset = g->totalOffset();
+// if (!totalOffset.isNull()) {
+// if (QApplication::isRightToLeft())
+// totalOffset.rwidth() *= -1;
+// // QPlainTextEdit scrolls by lines only in vertical direction
+// QFontMetrics fm(q->document()->defaultFont());
+// int lineHeight = fm.height();
+// int newX = hBar->value() - g->lastOffset().width();
+// int newY = originalOffsetY - totalOffset.height()/lineHeight;
+// hbar->setValue(newX);
+// vbar->setValue(newY);
+// }
+//}
QT_END_NAMESPACE