9#include <QtQuick/private/qquickstate_p.h>
10#include <private/qqmlglobal_p.h>
11#include <private/qqmlopenmetaobject_p.h>
12#include <private/qqmlchangeset_p.h>
13#include <qpa/qplatformtheme.h>
15#include <QtQml/qqmlinfo.h>
17#include <QtGui/private/qeventpoint_p.h>
18#include <QtGui/qevent.h>
19#include <QtGui/qguiapplication.h>
20#include <QtGui/private/qguiapplication_p.h>
21#include <QtGui/qstylehints.h>
22#include <QtCore/qmath.h>
29#if !QT_CONFIG(quick_itemview)
37:
QObject(parent), m_percent(-1), m_view(
nullptr), m_onPath(
false), m_isCurrent(
false)
41 m_metaobject->setCached(
true);
61 :
path(
nullptr), currentIndex(0), currentItemOffset(0), startPc(0)
62 ,
offset(0), offsetAdj(0), mappedRange(1), mappedCache(0)
63 , stealMouse(
false), ownModel(
false), interactive(true), haveHighlightRange(true)
64 , autoHighlight(true), highlightUp(
false), layoutScheduled(
false)
67 , dragMargin(0), deceleration(100)
70 , pathItems(-1), requestedIndex(-1),
cacheSize(0), requestedCacheSize(0), requestedZ(0)
74 , highlightPosition(0)
75 , highlightRangeStart(0), highlightRangeEnd(0)
77 , highlightMoveDuration(300), modelCount(0), snapMode(
QQuickPathView::NoSnap)
88 q->setFiltersChildMouseEvents(
true);
110 qmlWarning(delegate ? delegate :
q) << QQuickPathView::tr(
"Delegate must be of Item type");
124void QQuickPathView::createdItem(
int index,
QObject *
object)
128 if (
d->requestedIndex !=
index) {
137 d->updateItem(
item, 1);
139 d->requestedIndex = -1;
145void QQuickPathView::initItem(
int index,
QObject *
object)
158 if (percent < 1 && d->
path) {
159 const auto attributes =
d->path->attributes();
160 for (
const QString &attr : attributes)
162 item->setZ(
d->requestedZ);
173 qCDebug(lcItemViewDelegateLifecycle) <<
"release" <<
item;
201 const auto attributes =
path->attributes();
202 for (
const QString &attr : attributes)
262 globalPos = std::fmod(globalPos,
qreal(1));
275 qreal upper,
bool emptyRangeCheck)
const
290 if (!
q->isComponentComplete())
293 bool changed =
false;
305 creationContext ? creationContext :
qmlContext(
q));
313 delete highlightContext;
325 emit q->highlightItemChanged();
331 if (!
q->isComponentComplete() || !
isValid())
380 qreal diff = 1 - relativeHighlight;
395void QQuickPathView::pathUpdated()
413 const auto attributes =
path->attributes();
414 for (
const QString &attr : attributes)
415 att->
setValue(attr.toUtf8(),
path->attributeAt(attr, percent));
427 if (!
q->isComponentComplete())
447 emit q->dragStarted();
451 emit q->draggingChanged();
533 d->attType->release();
597 return d->modelVariant;
607 if (
d->modelVariant ==
model)
623 if (
object && (vim = qobject_cast<QQmlInstanceModel *>(
object))) {
639 int oldModelCount =
d->modelCount;
648 d->modelCount =
d->model->count();
651 if (
d->currentIndex != 0) {
661 if (
d->modelCount != oldModelCount)
673 return d->model ?
d->modelCount : 0;
706 d->attType->release();
707 d->attType =
nullptr;
723 return d->currentIndex;
730 if (idx !=
d->currentIndex) {
731 d->currentIndex = idx;
738 ? ((idx %
d->modelCount) +
d->modelCount) %
d->modelCount
740 if (
d->model && (idx !=
d->currentIndex || !
d->currentItem)) {
741 if (
d->currentItem) {
744 d->releaseItem(
d->currentItem);
746 int oldCurrentIdx =
d->currentIndex;
748 d->currentItem =
nullptr;
750 d->currentIndex = idx;
752 d->createCurrentItem();
755 d->currentItemOffset =
d->positionOfIndex(
d->currentIndex);
756 d->updateHighlight();
758 if (oldCurrentIdx !=
d->currentIndex)
760 if (oldCurrentItem !=
d->currentItem)
772 return d->currentItem;
827 if (
isValid() &&
q->isComponentComplete()) {
832 qCDebug(lcItemViewDelegateLifecycle) <<
o <<
"was" << oldOffset <<
"now" <<
offset;
837 emit q->offsetChanged();
872 return d->highlightComponent;
880 d->createHighlight();
881 d->updateHighlight();
897 return d->highlightItem;
939 return d->highlightRangeStart;
947 d->highlightRangeStart =
start;
948 d->haveHighlightRange =
d->highlightRangeStart <=
d->highlightRangeEnd;
956 return d->highlightRangeEnd;
964 d->highlightRangeEnd =
end;
965 d->haveHighlightRange =
d->highlightRangeStart <=
d->highlightRangeEnd;
973 return d->highlightRangeMode;
979 if (
d->highlightRangeMode ==
mode)
981 d->highlightRangeMode =
mode;
982 d->haveHighlightRange =
d->highlightRangeStart <=
d->highlightRangeEnd;
983 if (
d->haveHighlightRange) {
1004 return d->highlightMoveDuration;
1010 if (
d->highlightMoveDuration == duration)
1012 d->highlightMoveDuration = duration;
1027 return d->dragMargin;
1048 return d->deceleration;
1056 d->deceleration =
dec;
1069 return d->maximumFlickVelocity;
1077 d->maximumFlickVelocity = vel;
1093 return d->interactive;
1213 return dataModel->delegate();
1231 int oldCount = dataModel->
count();
1233 d->modelCount = dataModel->count();
1235 if (oldCount != dataModel->count())
1238 d->delegateValidated =
false;
1251 return d->pathItems;
1257 if (
i ==
d->pathItems)
1262 d->updateMappedRange();
1272 if (-1 ==
d->pathItems)
1275 d->updateMappedRange();
1305 return d->requestedCacheSize;
1311 if (
i ==
d->requestedCacheSize ||
i < 0)
1314 d->requestedCacheSize =
i;
1315 d->updateMappedRange();
1347 if (
mode ==
d->snapMode)
1379 return d->movementDirection;
1385 if (
dir ==
d->movementDirection)
1387 d->movementDirection =
dir;
1388 if (!
d->tl.isActive())
1389 d->moveDirection =
d->movementDirection;
1390 emit movementDirectionChanged();
1426 int count =
d->pathItems == -1 ?
d->modelCount :
qMin(
d->pathItems,
d->modelCount);
1427 int idx = (
index+
d->modelCount) %
d->modelCount;
1434 beginOffset =
d->modelCount - idx -
qFloor(
count *
d->highlightRangeStart);
1435 endOffset = beginOffset +
count - 1;
1437 beginOffset =
d->modelCount - idx;
1440 qreal adj =
sizeof(
qreal) ==
sizeof(
float) ? 0.00001f : 0.000000000001;
1441 endOffset = std::fmod(beginOffset +
count,
qreal(
d->modelCount)) - adj;
1452 if (beginOffset < endOffset)
1453 offset = (beginOffset + endOffset)/2;
1455 offset = (beginOffset + (endOffset +
d->modelCount))/2;
1460 if ((beginOffset < endOffset && (
d->offset < beginOffset ||
d->offset > endOffset))
1461 || (
d->offset < beginOffset &&
d->offset > endOffset)) {
1462 qreal diff1 = std::fmod(beginOffset -
d->offset +
d->modelCount,
qreal(
d->modelCount));
1463 qreal diff2 = std::fmod(
d->offset - endOffset +
d->modelCount,
qreal(
d->modelCount));
1491 return item ?
d->model->indexOf(
item,
nullptr) : -1;
1537 if (
index ==
d->model->indexOf(
item,
nullptr))
1554 const auto pathLength =
path->path().length();
1558 qreal mindist = 1e10;
1567 if (
dist < mindist) {
1575 qreal approxPc = nearPc;
1576 for (
qreal i = approxPc-1;
i < approxPc+1;
i += 1/(2*
res)) {
1580 if (
dist < mindist) {
1588 *nearPercent = nearPc /
samples;
1598 qCDebug(lcPathView) <<
"instantaneous velocity" <<
v;
1611 qCDebug(lcPathView) <<
"average velocity" << velocity <<
"based on" <<
count <<
"samples";
1618 if (0 !=
event->timestamp())
1626 if (
d->interactive) {
1627 d->handleMousePressEvent(
event);
1673 if (
d->interactive) {
1674 d->handleMouseMoveEvent(
event);
1699 if (
qAbs(pathDelta.x()) > startDragDistance * 0.8
1700 ||
qAbs(pathDelta.y()) > startDragDistance * 0.8) {
1702 q->setKeepMouseGrab(
true);
1723 emit q->movingChanged();
1724 emit q->movementStarted();
1735 if (
d->interactive) {
1736 d->handleMouseReleaseEvent(
event);
1748 q->setKeepMouseGrab(
false);
1753 q->movementEnding();
1763 qCDebug(lcPathView) <<
"after elapsed time" <<
elapsed <<
"velocity decayed to" << velocity;
1765 const auto averageItemLength =
path->path().length() /
count;
1766 qreal pixelVelocity = averageItemLength * velocity;
1771 velocity = maxVel / averageItemLength;
1812 emit q->flickingChanged();
1813 emit q->flickStarted();
1821 q->movementEnding();
1837 if (grabber ==
this &&
d->stealMouse) {
1842 bool grabberDisabled = grabber && !grabber->isEnabled();
1843 bool stealThisEvent =
d->stealMouse;
1844 if ((stealThisEvent ||
contains(localPos)) && (!grabber || !grabber->keepMouseGrab() || grabberDisabled)) {
1847 QMutableEventPoint::setPosition(localizedEvent.point(0), localPos);
1848 localizedEvent.setAccepted(
false);
1850 switch (localizedEvent.type()) {
1856 stealThisEvent =
d->stealMouse;
1866 if ((grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber !=
this) || grabberDisabled)
1867 pe->setExclusiveGrabber(point,
this);
1869 const bool filtered = stealThisEvent || grabberDisabled;
1871 pe->setAccepted(stealThisEvent && grabber ==
this && grabber->isEnabled());
1874 }
else if (
d->timer.isValid()) {
1875 d->timer.invalidate();
1879 d->stealMouse =
false;
1889 if (
d->stealMouse ||
1893 d->stealMouse =
false;
1895 d->timer.invalidate();
1897 d->setDragging(
false);
1898 if (!
d->tl.isActive())
1911 if (currentIndex < 0)
1912 return modelCount + currentIndex % modelCount;
1914 return currentIndex % modelCount;
1920 if (
d->model &&
d->ownModel)
1926 d->modelCount =
d->model->count();
1927 if (
d->modelCount &&
d->currentIndex != 0)
1931 d->createHighlight();
1933 d->updateHighlight();
1940void QQuickPathView::refill()
1945 d->scheduleLayout();
1949 d->layoutScheduled =
false;
1956 bool currentVisible =
false;
1957 int count =
d->pathItems == -1 ?
d->modelCount :
qMin(
d->pathItems,
d->modelCount);
1960 qCDebug(lcItemViewDelegateLifecycle) <<
"currentIndex" <<
d->currentIndex <<
"offset" <<
d->offset;
1962 while (
it !=
d->items.end()) {
1964 int idx =
d->model->indexOf(
item,
nullptr);
1966 if (lcItemViewDelegateLifecycle().isDebugEnabled()) {
1971 qCDebug(lcItemViewDelegateLifecycle) <<
"idx" << idx <<
"@" <<
pos <<
":" <<
item;
1975 if (idx ==
d->currentIndex) {
1976 currentVisible =
true;
1977 d->currentItemOffset =
pos;
1984 if (!
d->isInBound(
pos,
d->mappedRange -
d->mappedCache, 1 +
d->mappedCache)) {
1985 qCDebug(lcItemViewDelegateLifecycle) <<
"release" << idx <<
"@" <<
pos <<
", !isInBound: lower" << (
d->mappedRange -
d->mappedCache) <<
"upper" << (1 +
d->mappedCache);
1986 d->releaseItem(
item);
1987 it =
d->items.erase(
it);
1994 bool waiting =
false;
1995 if (
d->modelCount) {
1997 if (
d->items.size() <
count+
d->cacheSize) {
2002 const bool wasEmpty =
d->items.isEmpty();
2009 int idx =
d->model->indexOf(
item,
nullptr);
2010 qreal curPos =
d->positionOfIndex(idx);
2011 if (curPos > endPos) {
2016 if (curPos < startPos) {
2022 if (
d->haveHighlightRange
2025 startPos =
d->highlightRangeStart;
2027 endIdx = (
qRound(
d->modelCount -
d->offset) - 1) %
d->modelCount;
2028 endIdx =
qMax(-1, endIdx);
2029 endPos =
d->positionOfIndex(endIdx);
2032 int idx = endIdx + 1;
2033 if (idx >=
d->modelCount)
2035 qreal nextPos =
d->positionOfIndex(idx);
2036 while ((
d->isInBound(nextPos, endPos, 1 +
d->mappedCache,
false) || !
d->items.size())
2037 &&
d->items.size() <
count +
d->cacheSize) {
2038 qCDebug(lcItemViewDelegateLifecycle) <<
"append" << idx <<
"@" << nextPos << (
d->currentIndex == idx ?
"current" :
"") <<
"items count was" <<
d->items.size();
2044 if (
d->items.contains(
item)) {
2045 d->releaseItem(
item);
2048 if (
d->currentIndex == idx) {
2049 currentVisible =
true;
2050 d->currentItemOffset = nextPos;
2052 d->items.append(
item);
2053 d->updateItem(
item, nextPos);
2057 if (idx >=
d->modelCount)
2059 nextPos =
d->positionOfIndex(idx);
2063 idx = (wasEmpty ?
d->calcCurrentIndex() : startIdx) - 1;
2066 idx =
d->modelCount - 1;
2067 nextPos =
d->positionOfIndex(idx);
2068 while (!waiting &&
d->isInBound(nextPos,
d->mappedRange -
d->mappedCache, startPos)
2069 &&
d->items.size() <
count+
d->cacheSize) {
2070 qCDebug(lcItemViewDelegateLifecycle) <<
"prepend" << idx <<
"@" << nextPos << (
d->currentIndex == idx ?
"current" :
"") <<
"items count was" <<
d->items.size();
2076 if (
d->items.contains(
item)) {
2077 d->releaseItem(
item);
2080 if (
d->currentIndex == idx) {
2081 currentVisible =
true;
2082 d->currentItemOffset = nextPos;
2084 d->items.prepend(
item);
2085 d->updateItem(
item, nextPos);
2090 idx =
d->modelCount - 1;
2091 nextPos =
d->positionOfIndex(idx);
2098 if (!waiting &&
d->items.size() <
count+
d->cacheSize) {
2099 qCDebug(lcItemViewDelegateLifecycle) <<
"Checking for pathview middle inserts, items count was" <<
d->items.size();
2102 while (idx != endIdx) {
2103 nextPos =
d->positionOfIndex(idx);
2104 if (
d->isInBound(nextPos,
d->mappedRange -
d->mappedCache, 1 +
d->mappedCache)) {
2112 if (!
d->items.contains(
item)) {
2113 qCDebug(lcItemViewDelegateLifecycle) <<
"middle insert" << idx <<
"@" << nextPos
2114 << (
d->currentIndex == idx ?
"current" :
"")
2115 <<
"items count was" <<
d->items.size();
2116 if (
d->currentIndex == idx) {
2117 currentVisible =
true;
2118 d->currentItemOffset = nextPos;
2120 int lastListIdx =
d->items.indexOf(lastItem);
2121 d->items.insert(lastListIdx + 1,
item);
2122 d->updateItem(
item, nextPos);
2124 d->releaseItem(
item);
2131 if (idx >=
d->modelCount)
2138 bool currentChanged =
false;
2139 if (!currentVisible) {
2140 d->currentItemOffset = 1;
2141 if (
d->currentItem) {
2142 d->updateItem(
d->currentItem, 1);
2143 }
else if (!waiting &&
d->currentIndex >= 0 &&
d->currentIndex <
d->modelCount) {
2144 if ((
d->currentItem =
d->getItem(
d->currentIndex,
d->currentIndex))) {
2145 currentChanged =
true;
2146 d->updateItem(
d->currentItem, 1);
2151 }
else if (!waiting && !
d->currentItem) {
2152 if ((
d->currentItem =
d->getItem(
d->currentIndex,
d->currentIndex))) {
2153 currentChanged =
true;
2154 d->currentItem->setFocus(
true);
2161 d->updateItem(
d->highlightItem,
d->highlightRangeStart);
2165 d->updateItem(
d->highlightItem,
d->currentItemOffset);
2170 d->releaseItem(
item);
2171 d->itemCache.clear();
2173 d->inRefill =
false;
2185 d->modelCount =
d->model->count();
2191 if (changeSet.
removes().isEmpty() && changeSet.
inserts().isEmpty())
2194 const int modelCount =
d->modelCount;
2197 bool currentChanged =
false;
2198 bool changedOffset =
false;
2200 if (moveId == -1 &&
d->currentIndex >=
r.index +
r.count) {
2201 d->currentIndex -=
r.count;
2202 currentChanged =
true;
2203 }
else if (moveId == -1 &&
d->currentIndex >=
r.index &&
d->currentIndex <
r.index +
r.count) {
2207 moveOffset =
d->currentIndex -
r.index;
2208 }
else if (
d->currentItem) {
2211 d->releaseItem(
d->currentItem);
2212 d->currentItem =
nullptr;
2214 d->currentIndex =
qMin(
r.index,
d->modelCount -
r.count - 1);
2215 currentChanged =
true;
2218 if (
r.index >
d->currentIndex) {
2219 changedOffset =
true;
2220 d->offset -=
r.count;
2221 d->offsetAdj -=
r.count;
2223 d->modelCount -=
r.count;
2226 if (
d->modelCount) {
2227 if (moveId == -1 &&
i.index <=
d->currentIndex) {
2228 d->currentIndex +=
i.count;
2229 currentChanged =
true;
2231 if (moveId != -1 && moveId ==
i.moveId) {
2232 d->currentIndex =
i.index + moveOffset;
2233 currentChanged =
true;
2235 if (
i.index >
d->currentIndex) {
2236 d->offset +=
i.count;
2237 d->offsetAdj +=
i.count;
2238 changedOffset =
true;
2242 d->modelCount +=
i.count;
2245 d->offset = std::fmod(
d->offset,
qreal(
d->modelCount));
2247 d->offset +=
d->modelCount;
2248 if (
d->currentIndex == -1)
2249 d->currentIndex =
d->calcCurrentIndex();
2251 d->itemCache +=
d->items;
2254 if (!
d->modelCount) {
2256 d->releaseItem(
item);
2257 d->itemCache.clear();
2259 changedOffset =
true;
2260 d->tl.reset(
d->moveOffset);
2263 d->offset = std::fmod(
qreal(
d->modelCount -
d->currentIndex),
qreal(
d->modelCount));
2264 changedOffset =
true;
2266 d->updateMappedRange();
2267 d->scheduleLayout();
2273 if (
d->modelCount != modelCount)
2282void QQuickPathView::ticked()
2288void QQuickPathView::movementEnding()
2292 d->flicking =
false;
2296 if (
d->moving && !
d->stealMouse) {
2301 d->moveDirection =
d->movementDirection;
2324 bool inItems =
false;
2367 emit q->currentIndexChanged();
2368 emit q->currentItemChanged();
2385 q->setCurrentIndex(curr);
2407 const qreal threshold = 0.5 / averageItemLength;
2441#include "moc_qquickpathview_p.cpp"
void invalidate() noexcept
Marks this QElapsedTimer object as invalid.
qint64 elapsed() const noexcept
Returns the number of milliseconds since this QElapsedTimer was last started.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
bool isValid() const noexcept
Returns false if the timer has never been started or invalidated by a call to invalidate().
bool isPointerEvent() const noexcept
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise,...
QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const
Maps the point point, which is in item's coordinate system, to this item's coordinate system,...
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate sy...
static QStyleHints * styleHints()
Returns the application's style hints.
The QJSValue class acts as a container for Qt/JavaScript data types.
static constexpr Policy Preferred
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void deleteLater()
\threadsafe
void remove(int idx, int count=1)
const T & at(int idx) const
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
A base class for pointer events.
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
const QVector< Change > & removes() const
const QVector< Change > & inserts() const
The QQmlComponent class encapsulates a QML component definition.
QQmlContext * creationContext() const
Returns the QQmlContext the component was created in.
virtual QObject * create(QQmlContext *context=nullptr)
Create an object instance from this component, within the specified context.
The QQmlContext class defines a context within a QML engine.
void setModel(const QVariant &)
int count() const override
\qmlproperty int QtQml.Models::DelegateModel::count
virtual int indexOf(QObject *object, QObject *objectContext) const =0
virtual ReleaseFlags release(QObject *object, ReusableFlag reusableFlag=NotReusable)=0
static bool isMouseEvent(const QPointerEvent *ev)
static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold=-1)
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void setSizePolicy(const QLayoutPolicy::Policy &horizontalPolicy, const QLayoutPolicy::Policy &verticalPolicy)
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
virtual void mouseReleaseEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
void setParentItem(QQuickItem *parent)
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
QPointF mapFromScene(const QPointF &point) const
Maps the given point in the scene's coordinate system to the equivalent point within this item's coor...
virtual Q_INVOKABLE bool contains(const QPointF &point) const
\qmlmethod bool QtQuick::Item::contains(point point)
virtual void mousePressEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
void setKeepMouseGrab(bool)
Sets whether the mouse input should remain exclusively with this item.
virtual bool childMouseEventFilter(QQuickItem *, QEvent *)
Reimplement this method to filter the pointer events that are received by this item's children.
virtual void updatePolish()
This function should perform any layout as required for this item.
virtual void mouseMoveEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void setIsCurrentItem(bool c)
void setValue(const QByteArray &name, const QVariant &val)
QVariant value(const QByteArray &name) const
~QQuickPathViewAttached()
QPointer< QQmlInstanceModel > model
void releaseItem(QQuickItem *item)
qint64 computeCurrentTime(QInputEvent *event) const
void updateItem(QQuickItem *, qreal)
void snapToIndex(int index, MovementReason reason)
QPODVector< qreal, 10 > velocityBuffer
void handleMousePressEvent(QMouseEvent *event)
QQmlOpenMetaObjectType * attType
QQuickItem * highlightItem
void handleMouseReleaseEvent(QMouseEvent *)
QPointer< QQuickItem > currentItem
QQmlComponent * highlightComponent
void setAdjustedOffset(qreal offset)
qreal highlightRangeStart
int highlightMoveDuration
QQuickTimeLineValueProxy< QQuickPathViewPrivate > moveHighlight
void setHighlightPosition(qreal pos)
QQuickTimeLineValueProxy< QQuickPathViewPrivate > moveOffset
void handleMouseMoveEvent(QMouseEvent *event)
qreal maximumFlickVelocity
QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const
void setOffset(qreal offset)
QQmlOpenMetaObjectType * attachedType()
qreal positionOfIndex(qreal index) const
QQuickItem * getItem(int modelIndex, qreal z=0, bool async=false)
QList< QQuickItem * > itemCache
QQuickPathView::SnapMode snapMode
QQuickPathView::HighlightRangeMode highlightRangeMode
void addVelocitySample(qreal v)
QQuickPathView::MovementDirection moveDirection
qreal calcVelocity() const
QQuickPathViewAttached * attached(QQuickItem *item)
QList< QQuickItem * > items
bool isInBound(qreal position, qreal lower, qreal upper, bool emptyRangeCheck=true) const
static void fixOffsetCallback(void *)
MovementReason moveReason
void setPreferredHighlightBegin(qreal)
void setInteractive(bool)
void resetPathItemCount()
MovementDirection movementDirection
void decrementCurrentIndex()
\qmlmethod QtQuick::PathView::decrementCurrentIndex()
qreal preferredHighlightEnd
virtual ~QQuickPathView()
void setCacheItemCount(int)
void interactiveChanged()
void setModel(const QVariant &)
void updatePolish() override
This function should perform any layout as required for this item.
void setHighlightRangeMode(HighlightRangeMode mode)
QQuickPathView(QQuickItem *parent=nullptr)
void cacheItemCountChanged()
void setFlickDeceleration(qreal dec)
void setSnapMode(SnapMode mode)
QQuickItem * highlightItem
void highlightMoveDurationChanged()
void setCurrentIndex(int idx)
bool isMoving() const
\qmlproperty bool QtQuick::PathView::moving
void pathItemCountChanged()
void flickDecelerationChanged()
int highlightMoveDuration
void setOffset(qreal offset)
void currentItemChanged()
friend class QQuickPathViewAttached
bool childMouseEventFilter(QQuickItem *, QEvent *) override
Reimplement this method to filter the pointer events that are received by this item's children.
QQmlComponent * highlight
bool isInteractive() const
\qmlproperty bool QtQuick::PathView::interactive
void incrementCurrentIndex()
\qmlmethod QtQuick::PathView::incrementCurrentIndex()
void preferredHighlightEndChanged()
qreal maximumFlickVelocity
void currentIndexChanged()
void setMovementDirection(MovementDirection dir)
void setMaximumFlickVelocity(qreal)
bool isFlicking() const
\qmlproperty bool QtQuick::PathView::flicking
void setHighlight(QQmlComponent *highlight)
Q_INVOKABLE int indexAt(qreal x, qreal y) const
\qmlmethod int QtQuick::PathView::indexAt(real x, real y)
void setDelegate(QQmlComponent *)
void maximumFlickVelocityChanged()
void setHighlightMoveDuration(int)
void mouseMoveEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void setPath(QQuickPath *)
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
Q_INVOKABLE QQuickItem * itemAt(qreal x, qreal y) const
\qmlmethod Item QtQuick::PathView::itemAt(real x, real y)
qreal preferredHighlightBegin
void preferredHighlightBeginChanged()
void setDragMargin(qreal margin)
bool isDragging() const
\qmlproperty bool QtQuick::PathView::dragging
void mouseReleaseEvent(QMouseEvent *) override
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void setPathItemCount(int)
void mouseUngrabEvent() override
This event handler can be reimplemented in a subclass to be notified when a mouse ungrab event has oc...
HighlightRangeMode highlightRangeMode
Q_INVOKABLE void positionViewAtIndex(int index, int mode)
\qmlmethod QtQuick::PathView::positionViewAtIndex(int index, PositionMode mode)
static QQuickPathViewAttached * qmlAttachedProperties(QObject *)
void highlightRangeModeChanged()
void setPreferredHighlightEnd(qreal)
void setValue(qreal v) override
Set the current value.
The QQuickTimeLine class provides a timeline for controlling animations.
void reset(QQuickTimeLineValue &)
Cancel (but don't complete) all scheduled actions for timeLineValue.
int accel(QQuickTimeLineValue &, qreal velocity, qreal accel)
Decelerate timeLineValue from the starting velocity to zero at the given acceleration rate.
void callback(const QQuickTimeLineCallback &)
Execute the event.
bool isActive() const
Returns true if the timeline is active.
void clear()
Resets the timeline.
void set(QQuickTimeLineValue &, qreal)
Set the value of timeLineValue.
void move(QQuickTimeLineValue &, qreal destination, int time=500)
Linearly change the timeLineValue from its current value to the given destination value over time mil...
A base class for pointer events containing a single point, such as mouse events.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString left(qsizetype n) const &
QSet< QString >::iterator it
Combined button and popup list for selecting options.
int toUtf8(char16_t u, OutputPtr &dst, InputPtr &src, InputPtr end)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLenum GLenum GLsizei count
GLsizei GLsizei GLfloat distance
GLenum GLuint GLintptr offset
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
static quint64 cacheSize()
QQmlContext * qmlContext(const QObject *obj)
#define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Disconnect Signal of Sender from Method of Receiver.
#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Connect Signal of Sender to Method of Receiver.
void QQml_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QQuickItem * qmlobject_cast< QQuickItem * >(QObject *object)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QML_FLICK_SAMPLEBUFFER
const qreal _q_MinimumFlickVelocity
#define QML_FLICK_DISCARDSAMPLES
#define QML_FLICK_VELOCITY_DECAY_TIME
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
static QT_BEGIN_NAMESPACE QQmlOpenMetaObjectType * qPathViewAttachedType
static int currentIndexRemainder(int currentIndex, int modelCount) noexcept
static double elapsed(qint64 after, qint64 before)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, JSToQVariantConversionBehavior conversionBehavior, V4ObjectSet *visitedObjects)
std::uniform_real_distribution dist(1, 2.5)
[2]
settings setValue("DataPump/bgcolor", color)