summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qabstractscrollarea.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-05-18 07:55:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-18 07:55:56 (GMT)
commit06557b8d7c472c6298f7d8b310feda225864265f (patch)
tree571e5078ee66377cdadbc07fc7851b334c0d5272 /src/gui/widgets/qabstractscrollarea.cpp
parent83a2be48a82394ae692d91587c64f8ccd385350f (diff)
parentfa065de6eb49c706feb4a75db7bc0a4618a81a13 (diff)
downloadQt-06557b8d7c472c6298f7d8b310feda225864265f.zip
Qt-06557b8d7c472c6298f7d8b310feda225864265f.tar.gz
Qt-06557b8d7c472c6298f7d8b310feda225864265f.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team: (195 commits) Re-apply licenseheader text in source files for qt4.8 Revert all QScroller and QFlickGesture related code. Fix regression that caused waitForXXX(-1) to fail. Fix thread safety regression of QNetworkConfigurationManager Fix instability in QNetworkConfigurationManager autotest Support word selection list with predictive text from splitview Fix softkey icon positioning in S60 5.3 QDeclarativeMouseArea: block context menu events ListViews loses items if all visible items are removed. Make TextEdit word selection more natural. Fixed license header. Ensure that recursive QMAKE_EXTRA_TARGETS use the correct makefile Clear confusion between QMainWindow and QMainWindowLayout. Fix for rounded corners bug in QMenu Compile QWidgetPrivate::setParent_sys might be using null pointer Ensure the TextEdit cursor delegate is repositioned on mouse events. Don't crash on an invalid replacementStart from an input method. Fix QGLWidget::renderPixmap for raster engine on Mac Check if OES_texture_npot is present on OpenGL ES 2. ...
Diffstat (limited to 'src/gui/widgets/qabstractscrollarea.cpp')
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp107
1 files changed, 1 insertions, 106 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 6081bc8..c9c937f 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);