Add feature.scroller
Change-Id: I5313e1f5091d5764994525dae138e288e5125c59 Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
b41492d53e
commit
e1b9ddc105
|
|
@ -324,6 +324,12 @@
|
|||
"condition": "features.scrollbar",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"scroller": {
|
||||
"label": "QScroller",
|
||||
"purpose": "Enables kinetic scrolling for any scrolling widget or graphics item.",
|
||||
"section": "Widgets",
|
||||
"output": [ "publicFeature" ]
|
||||
},
|
||||
"graphicsview": {
|
||||
"label": "QGraphicsView",
|
||||
"purpose": "Provides a canvas/sprite framework.",
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include <qaccessible.h>
|
||||
#endif
|
||||
#ifndef QT_NO_GESTURES
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
|
||||
# include <qscroller.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_GESTURES
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
|
||||
|
||||
// stores and restores the selection and current item when flicking
|
||||
void QAbstractItemViewPrivate::_q_scrollerStateChanged()
|
||||
|
|
@ -1736,7 +1736,7 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
|
|||
break;
|
||||
case QEvent::ScrollPrepare:
|
||||
executeDelayedItemsLayout();
|
||||
#ifndef QT_NO_GESTURES
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
|
||||
connect(QScroller::scroller(d->viewport), SIGNAL(stateChanged(QScroller::State)), this, SLOT(_q_scrollerStateChanged()), Qt::UniqueConnection);
|
||||
#endif
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ private:
|
|||
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_layoutChanged())
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_headerDataChanged())
|
||||
#ifndef QT_NO_GESTURES
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_scrollerStateChanged())
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@
|
|||
#include <QAbstractScrollArea>
|
||||
#include <QScrollBar>
|
||||
|
||||
#if QT_CONFIG(scroller)
|
||||
#include <qscroller.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -194,7 +196,7 @@ void QPixmapStyle::polish(QWidget *widget)
|
|||
view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
}
|
||||
#endif
|
||||
#if QT_CONFIG(gestures)
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
|
||||
QScroller::grabGesture(scrollArea->viewport(), QScroller::LeftMouseButtonGesture);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -235,7 +237,7 @@ void QPixmapStyle::unpolish(QWidget *widget)
|
|||
if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
|
||||
widget->removeEventFilter(this);
|
||||
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scrollarea)
|
||||
#if QT_CONFIG(gestures) && QT_CONFIG(scrollarea) && QT_CONFIG(scroller)
|
||||
if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget))
|
||||
QScroller::ungrabGesture(scrollArea->viewport());
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
#include <QtCore/QPointF>
|
||||
#include <QtWidgets/QScrollerProperties>
|
||||
|
||||
QT_REQUIRE_CONFIG(scroller);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
#include <QtCore/QMetaType>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
QT_REQUIRE_CONFIG(scroller);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,6 @@ HEADERS += \
|
|||
util/qcompleter.h \
|
||||
util/qcompleter_p.h \
|
||||
util/qsystemtrayicon_p.h \
|
||||
util/qscroller.h \
|
||||
util/qscroller_p.h \
|
||||
util/qscrollerproperties.h \
|
||||
util/qscrollerproperties_p.h \
|
||||
util/qflickgesture_p.h \
|
||||
util/qundogroup.h \
|
||||
util/qundostack.h \
|
||||
util/qundostack_p.h \
|
||||
|
|
@ -20,13 +15,24 @@ SOURCES += \
|
|||
util/qsystemtrayicon.cpp \
|
||||
util/qcolormap.cpp \
|
||||
util/qcompleter.cpp \
|
||||
util/qscroller.cpp \
|
||||
util/qscrollerproperties.cpp \
|
||||
util/qflickgesture.cpp \
|
||||
util/qundogroup.cpp \
|
||||
util/qundostack.cpp \
|
||||
util/qundoview.cpp
|
||||
|
||||
qtConfig(scroller) {
|
||||
HEADERS += \
|
||||
util/qscroller.h \
|
||||
util/qscroller_p.h \
|
||||
util/qscrollerproperties.h \
|
||||
util/qscrollerproperties_p.h \
|
||||
util/qflickgesture_p.h
|
||||
|
||||
SOURCES += \
|
||||
util/qscroller.cpp \
|
||||
util/qscrollerproperties.cpp \
|
||||
util/qflickgesture.cpp \
|
||||
}
|
||||
|
||||
win32:!winrt {
|
||||
SOURCES += util/qsystemtrayicon_win.cpp
|
||||
} else: qtConfig(xcb) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue