summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@nokia.com>2011-05-12 13:54:11 (GMT)
committerRobert Griebl <robert.griebl@nokia.com>2011-05-16 13:57:38 (GMT)
commit4f7af4c544c3b793ba8cccb28e5c856f3d754e4a (patch)
treedf28438d523460f8897e4242df20f47672efef63 /src/gui/widgets
parentcb5b6799333794496269aa7e6515f96c2ac96d37 (diff)
downloadQt-4f7af4c544c3b793ba8cccb28e5c856f3d754e4a.zip
Qt-4f7af4c544c3b793ba8cccb28e5c856f3d754e4a.tar.gz
Qt-4f7af4c544c3b793ba8cccb28e5c856f3d754e4a.tar.bz2
Revert all QScroller and QFlickGesture related code.
This reverts commits 0274e68767cce6440515a68d6af868725d5577a4 2770b1277744bb676e96e4ae8c89acd645ec895d 02e1f4e83dc8e3c4ab957095167b3d34c51ba3c1 fdf3be5b6b5db75833e0a7e9a90445ddd794fe4d d1f9a534da288884f443a975f428b0cfe0a7b29b 205d607c3387d074fb87f8deb77a8f515ae2e189 32d200da9cc7a4dfb3f302f22ef5718a286845c9 3e0df49f978933b1e4e6b48c695bf813ec9a2828 82bbc1c1611bde33680d22a1a3c6449e51d7b0b9 b78ffe51f9a4c4ac705e435d45fffe39864c032d fe438d7d828021d7f86301af36fe8dff2768532a df30d58de183d13c649ef7e0fbb8e2b3658e0862 fa845566b3733bc06454b71e33b1ff405ba32280 4f9a318d639c4e7e09e56751d31608fb39d472af 4810b587a65d81f8f90646efd09cadeb1276a756 7bad867382ad6c84155ffcfbb361709a8e8184ab 64ec011c6132496eb9555c1d09e7fd4ddf472837 81492e56aba5b5761500543665012a85d6835513 b668857b3749b39c3a61e0a25e750740b74df552 78a7a02b3b85435bc28eb23e9210522467171e42 Reviewed-By: Ralf Engels
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp107
-rw-r--r--src/gui/widgets/qabstractscrollarea_p.h2
2 files changed, 1 insertions, 108 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index dabfec0..2503b99 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -53,8 +53,6 @@
#include "qpainter.h"
#include "qmargins.h"
-#include <QDebug>
-
#include "qabstractscrollarea_p.h"
#include <qwidget.h>
@@ -64,10 +62,6 @@
#include <private/qt_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
-#ifdef Q_WS_WIN
-# include <qlibrary.h>
-# include <windows.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -301,14 +295,9 @@ void QAbstractScrollAreaPrivate::init()
q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layoutChildren();
#ifndef Q_WS_MAC
-# ifndef QT_NO_GESTURES
+#ifndef QT_NO_GESTURES
viewport->grabGesture(Qt::PanGesture);
-# endif
#endif
-#ifdef Q_WS_MAEMO_5
-# ifndef QT_NO_GESTURES
- // viewport->grabGesture(Qt::TouchFlickGesture);
-# endif
#endif
}
@@ -563,11 +552,6 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport->grabGesture(Qt::PanGesture);
#endif
#endif
-#ifdef Q_WS_MAEMO_5
-#ifndef QT_NO_GESTURES
-// d->viewport->grabGesture(Qt::TouchFlickGesture);
-#endif
-#endif
d->layoutChildren();
if (isVisible())
d->viewport->show();
@@ -1002,66 +986,6 @@ bool QAbstractScrollArea::event(QEvent *e)
return false;
}
#endif // QT_NO_GESTURES
- case QEvent::ScrollPrepare:
- {
- QScrollPrepareEvent *se = static_cast<QScrollPrepareEvent *>(e);
- if (d->canStartScrollingAt(se->startPos().toPoint())) {
- QScrollBar *hBar = horizontalScrollBar();
- QScrollBar *vBar = verticalScrollBar();
-
- se->setViewportSize(QSizeF(viewport()->size()));
- se->setContentPosRange(QRectF(0, 0, hBar->maximum(), vBar->maximum()));
- se->setContentPos(QPointF(hBar->value(), vBar->value()));
- se->accept();
- return true;
- }
- return false;
- }
- case QEvent::Scroll:
- {
- QScrollEvent *se = static_cast<QScrollEvent *>(e);
-
- QScrollBar *hBar = horizontalScrollBar();
- QScrollBar *vBar = verticalScrollBar();
- hBar->setValue(se->contentPos().x());
- vBar->setValue(se->contentPos().y());
-
-#ifdef Q_WS_WIN
- typedef BOOL (*PtrBeginPanningFeedback)(HWND);
- typedef BOOL (*PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL);
- typedef BOOL (*PtrEndPanningFeedback)(HWND, BOOL);
-
- static PtrBeginPanningFeedback ptrBeginPanningFeedback = 0;
- static PtrUpdatePanningFeedback ptrUpdatePanningFeedback = 0;
- static PtrEndPanningFeedback ptrEndPanningFeedback = 0;
-
- if (!ptrBeginPanningFeedback)
- ptrBeginPanningFeedback = (PtrBeginPanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback");
- if (!ptrUpdatePanningFeedback)
- ptrUpdatePanningFeedback = (PtrUpdatePanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "UpdatePanningFeedback");
- if (!ptrEndPanningFeedback)
- ptrEndPanningFeedback = (PtrEndPanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "EndPanningFeedback");
-
- if (ptrBeginPanningFeedback && ptrUpdatePanningFeedback && ptrEndPanningFeedback) {
- WId wid = window()->winId();
-
- if (!se->overshootDistance().isNull() && d->overshoot.isNull())
- ptrBeginPanningFeedback(wid);
- if (!se->overshootDistance().isNull())
- ptrUpdatePanningFeedback(wid, -se->overshootDistance().x(), -se->overshootDistance().y(), false);
- if (se->overshootDistance().isNull() && !d->overshoot.isNull())
- ptrEndPanningFeedback(wid, true);
- } else
-#endif
- {
- QPoint delta = d->overshoot - se->overshootDistance().toPoint();
- if (!delta.isNull())
- viewport()->move(viewport()->pos() + delta);
- }
- d->overshoot = se->overshootDistance().toPoint();
-
- return true;
- }
case QEvent::StyleChange:
case QEvent::LayoutDirectionChange:
case QEvent::ApplicationLayoutDirectionChange:
@@ -1123,9 +1047,6 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e)
case QEvent::GestureOverride:
return event(e);
#endif
- case QEvent::ScrollPrepare:
- case QEvent::Scroll:
- return event(e);
default:
break;
}
@@ -1382,32 +1303,6 @@ void QAbstractScrollArea::scrollContentsBy(int, int)
viewport()->update();
}
-bool QAbstractScrollAreaPrivate::canStartScrollingAt( const QPoint &startPos )
-{
- Q_Q(QAbstractScrollArea);
-
-#ifndef QT_NO_GRAPHICSVIEW
- // don't start scrolling when a drag mode has been set.
- // don't start scrolling on a movable item.
- if (QGraphicsView *view = qobject_cast<QGraphicsView *>(q)) {
- if (view->dragMode() != QGraphicsView::NoDrag)
- return false;
-
- QGraphicsItem *childItem = view->itemAt(startPos);
-
- if (childItem && (childItem->flags() & QGraphicsItem::ItemIsMovable))
- return false;
- }
-#endif
-
- // don't start scrolling on a QAbstractSlider
- if (qobject_cast<QAbstractSlider *>(q->viewport()->childAt(startPos))) {
- return false;
- }
-
- return true;
-}
-
void QAbstractScrollAreaPrivate::_q_hslide(int x)
{
Q_Q(QAbstractScrollArea);
diff --git a/src/gui/widgets/qabstractscrollarea_p.h b/src/gui/widgets/qabstractscrollarea_p.h
index 76e1c34..85536e3 100644
--- a/src/gui/widgets/qabstractscrollarea_p.h
+++ b/src/gui/widgets/qabstractscrollarea_p.h
@@ -84,13 +84,11 @@ public:
int left, top, right, bottom; // viewport margin
int xoffset, yoffset;
- QPoint overshoot;
void init();
void layoutChildren();
// ### Fix for 4.4, talk to Bjoern E or Girish.
virtual void scrollBarPolicyChanged(Qt::Orientation, Qt::ScrollBarPolicy) {}
- bool canStartScrollingAt( const QPoint &startPos );
void _q_hslide(int);
void _q_vslide(int);