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/qplatformintegration.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)
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), requestedZ(0)
74 , highlightPosition(0)
75 , highlightRangeStart(0), highlightRangeEnd(0)
77 , highlightMoveDuration(300), modelCount(0), snapMode(
QQuickPathView::NoSnap)
87 q->setFiltersChildMouseEvents(
true);
109 qmlWarning(delegate ? delegate :
q) << QQuickPathView::tr(
"Delegate must be of Item type");
123void QQuickPathView::createdItem(
int index,
QObject *
object)
127 if (
d->requestedIndex !=
index) {
136 d->updateItem(
item, 1);
138 d->requestedIndex = -1;
144void QQuickPathView::initItem(
int index,
QObject *
object)
157 if (percent < 1 && d->
path) {
158 const auto attributes =
d->path->attributes();
159 for (
const QString &attr : attributes)
161 item->setZ(
d->requestedZ);
172 qCDebug(lcItemViewDelegateLifecycle) <<
"release" <<
item;
200 const auto attributes =
path->attributes();
201 for (
const QString &attr : attributes)
257 globalPos = std::fmod(globalPos,
qreal(1));
284 if (!
q->isComponentComplete())
287 bool changed =
false;
299 creationContext ? creationContext :
qmlContext(
q));
307 delete highlightContext;
319 emit q->highlightItemChanged();
325 if (!
q->isComponentComplete() || !
isValid())
374 qreal diff = 1 - relativeHighlight;
389void QQuickPathView::pathUpdated()
407 const auto attributes =
path->attributes();
408 for (
const QString &attr : attributes)
409 att->
setValue(attr.toUtf8(),
path->attributeAt(attr, percent));
421 if (!
q->isComponentComplete())
441 emit q->dragStarted();
445 emit q->draggingChanged();
527 d->attType->release();
591 return d->modelVariant;
601 if (
d->modelVariant ==
model)
617 if (
object && (vim = qobject_cast<QQmlInstanceModel *>(
object))) {
631 dataModel->setModel(
model);
633 int oldModelCount =
d->modelCount;
642 d->modelCount =
d->model->count();
645 if (
d->currentIndex != 0) {
655 if (
d->modelCount != oldModelCount)
667 return d->model ?
d->modelCount : 0;
700 d->attType->release();
701 d->attType =
nullptr;
717 return d->currentIndex;
724 if (idx !=
d->currentIndex) {
725 d->currentIndex = idx;
732 ? ((idx %
d->modelCount) +
d->modelCount) %
d->modelCount
734 if (
d->model && (idx !=
d->currentIndex || !
d->currentItem)) {
735 if (
d->currentItem) {
738 d->releaseItem(
d->currentItem);
740 int oldCurrentIdx =
d->currentIndex;
742 d->currentItem =
nullptr;
744 d->currentIndex = idx;
746 d->createCurrentItem();
749 d->currentItemOffset =
d->positionOfIndex(
d->currentIndex);
750 d->updateHighlight();
752 if (oldCurrentIdx !=
d->currentIndex)
754 if (oldCurrentItem !=
d->currentItem)
766 return d->currentItem;
821 if (
isValid() &&
q->isComponentComplete()) {
826 qCDebug(lcItemViewDelegateLifecycle) <<
o <<
"was" << oldOffset <<
"now" <<
offset;
831 emit q->offsetChanged();
866 return d->highlightComponent;
874 d->createHighlight();
875 d->updateHighlight();
891 return d->highlightItem;
933 return d->highlightRangeStart;
941 d->highlightRangeStart =
start;
942 d->haveHighlightRange =
d->highlightRangeStart <=
d->highlightRangeEnd;
950 return d->highlightRangeEnd;
958 d->highlightRangeEnd =
end;
959 d->haveHighlightRange =
d->highlightRangeStart <=
d->highlightRangeEnd;
967 return d->highlightRangeMode;
973 if (
d->highlightRangeMode ==
mode)
975 d->highlightRangeMode =
mode;
976 d->haveHighlightRange =
d->highlightRangeStart <=
d->highlightRangeEnd;
977 if (
d->haveHighlightRange) {
998 return d->highlightMoveDuration;
1004 if (
d->highlightMoveDuration == duration)
1006 d->highlightMoveDuration = duration;
1021 return d->dragMargin;
1042 return d->deceleration;
1050 d->deceleration =
dec;
1063 return d->maximumFlickVelocity;
1071 d->maximumFlickVelocity = vel;
1087 return d->interactive;
1207 return dataModel->delegate();
1225 int oldCount = dataModel->count();
1227 d->modelCount = dataModel->count();
1229 if (oldCount != dataModel->count())
1232 d->delegateValidated =
false;
1245 return d->pathItems;
1251 if (
i ==
d->pathItems)
1256 d->updateMappedRange();
1266 if (-1 ==
d->pathItems)
1269 d->updateMappedRange();
1299 return d->cacheSize;
1305 if (
i ==
d->cacheSize ||
i < 0)
1309 d->updateMappedRange();
1341 if (
mode ==
d->snapMode)
1373 return d->movementDirection;
1379 if (
dir ==
d->movementDirection)
1381 d->movementDirection =
dir;
1382 if (!
d->tl.isActive())
1383 d->moveDirection =
d->movementDirection;
1384 emit movementDirectionChanged();
1420 int count =
d->pathItems == -1 ?
d->modelCount :
qMin(
d->pathItems,
d->modelCount);
1421 int idx = (
index+
d->modelCount) %
d->modelCount;
1428 beginOffset =
d->modelCount - idx -
qFloor(
count *
d->highlightRangeStart);
1429 endOffset = beginOffset +
count - 1;
1431 beginOffset =
d->modelCount - idx;
1434 qreal adj =
sizeof(
qreal) ==
sizeof(
float) ? 0.00001f : 0.000000000001;
1435 endOffset = std::fmod(beginOffset +
count,
qreal(
d->modelCount)) - adj;
1446 if (beginOffset < endOffset)
1447 offset = (beginOffset + endOffset)/2;
1449 offset = (beginOffset + (endOffset +
d->modelCount))/2;
1454 if ((beginOffset < endOffset && (
d->offset < beginOffset ||
d->offset > endOffset))
1455 || (
d->offset < beginOffset &&
d->offset > endOffset)) {
1456 qreal diff1 = std::fmod(beginOffset -
d->offset +
d->modelCount,
qreal(
d->modelCount));
1457 qreal diff2 = std::fmod(
d->offset - endOffset +
d->modelCount,
qreal(
d->modelCount));
1485 return item ?
d->model->indexOf(
item,
nullptr) : -1;
1531 if (
index ==
d->model->indexOf(
item,
nullptr))
1540 const auto pathLength =
path->path().length();
1544 qreal mindist = 1e10;
1553 if (
dist < mindist) {
1561 qreal approxPc = nearPc;
1562 for (
qreal i = approxPc-1;
i < approxPc+1;
i += 1/(2*
res)) {
1566 if (
dist < mindist) {
1574 *nearPercent = nearPc /
samples;
1584 qCDebug(lcPathView) <<
"instantaneous velocity" <<
v;
1597 qCDebug(lcPathView) <<
"average velocity" << velocity <<
"based on" <<
count <<
"samples";
1604 if (0 !=
event->timestamp())
1612 if (
d->interactive) {
1613 d->handleMousePressEvent(
event);
1659 if (
d->interactive) {
1660 d->handleMouseMoveEvent(
event);
1685 if (
qAbs(pathDelta.
x()) > startDragDistance * 0.8
1686 ||
qAbs(pathDelta.
y()) > startDragDistance * 0.8) {
1688 q->setKeepMouseGrab(
true);
1709 emit q->movingChanged();
1710 emit q->movementStarted();
1721 if (
d->interactive) {
1722 d->handleMouseReleaseEvent(
event);
1734 q->setKeepMouseGrab(
false);
1739 q->movementEnding();
1749 qCDebug(lcPathView) <<
"after elapsed time" <<
elapsed <<
"velocity decayed to" << velocity;
1751 const auto averageItemLength =
path->path().length() /
count;
1752 qreal pixelVelocity = averageItemLength * velocity;
1757 velocity = maxVel / averageItemLength;
1798 emit q->flickingChanged();
1799 emit q->flickStarted();
1807 q->movementEnding();
1813 if (!
isVisible() || !
d->interactive || !
e->isPointerEvent())
1823 if (grabber ==
this &&
d->stealMouse) {
1828 bool grabberDisabled = grabber && !grabber->
isEnabled();
1829 bool stealThisEvent =
d->stealMouse;
1830 if ((stealThisEvent ||
contains(localPos)) && (!grabber || !grabber->
keepMouseGrab() || grabberDisabled)) {
1833 QMutableEventPoint::setPosition(localizedEvent.
point(0), localPos);
1836 switch (localizedEvent.
type()) {
1842 stealThisEvent =
d->stealMouse;
1852 if ((grabber && stealThisEvent && !grabber->
keepMouseGrab() && grabber !=
this) || grabberDisabled)
1855 const bool filtered = stealThisEvent || grabberDisabled;
1859 }
else if (
d->timer.isValid()) {
1860 d->timer.invalidate();
1864 d->stealMouse =
false;
1874 if (
d->stealMouse ||
1878 d->stealMouse =
false;
1880 d->timer.invalidate();
1882 d->setDragging(
false);
1883 if (!
d->tl.isActive())
1896 if (currentIndex < 0)
1897 return modelCount + currentIndex % modelCount;
1899 return currentIndex % modelCount;
1905 if (
d->model &&
d->ownModel)
1911 d->modelCount =
d->model->count();
1912 if (
d->modelCount &&
d->currentIndex != 0)
1916 d->createHighlight();
1918 d->updateHighlight();
1925void QQuickPathView::refill()
1930 d->scheduleLayout();
1934 d->layoutScheduled =
false;
1941 bool currentVisible =
false;
1942 int count =
d->pathItems == -1 ?
d->modelCount :
qMin(
d->pathItems,
d->modelCount);
1945 qCDebug(lcItemViewDelegateLifecycle) <<
"currentIndex" <<
d->currentIndex <<
"offset" <<
d->offset;
1947 while (
it !=
d->items.end()) {
1949 int idx =
d->model->indexOf(
item,
nullptr);
1951 if (lcItemViewDelegateLifecycle().isDebugEnabled()) {
1956 qCDebug(lcItemViewDelegateLifecycle) <<
"idx" << idx <<
"@" <<
pos <<
":" <<
item;
1960 if (idx ==
d->currentIndex) {
1961 currentVisible =
true;
1962 d->currentItemOffset =
pos;
1969 if (!
d->isInBound(
pos,
d->mappedRange -
d->mappedCache, 1 +
d->mappedCache)) {
1970 qCDebug(lcItemViewDelegateLifecycle) <<
"release" << idx <<
"@" <<
pos <<
", !isInBound: lower" << (
d->mappedRange -
d->mappedCache) <<
"upper" << (1 +
d->mappedCache);
1971 d->releaseItem(
item);
1972 it =
d->items.erase(
it);
1979 bool waiting =
false;
1980 if (
d->modelCount) {
1982 if (
d->items.size() <
count+
d->cacheSize) {
1987 const bool wasEmpty =
d->items.isEmpty();
1994 int idx =
d->model->indexOf(
item,
nullptr);
1995 qreal curPos =
d->positionOfIndex(idx);
1996 if (curPos > endPos) {
2001 if (curPos < startPos) {
2007 if (
d->haveHighlightRange
2010 startPos =
d->highlightRangeStart;
2012 endIdx = (
qRound(
d->modelCount -
d->offset) - 1) %
d->modelCount;
2013 endPos =
d->positionOfIndex(endIdx);
2016 int idx = endIdx + 1;
2017 if (idx >=
d->modelCount)
2019 qreal nextPos =
d->positionOfIndex(idx);
2020 while ((
d->isInBound(nextPos, endPos, 1 +
d->mappedCache) || !
d->items.size())
2021 &&
d->items.size() <
count+
d->cacheSize) {
2022 qCDebug(lcItemViewDelegateLifecycle) <<
"append" << idx <<
"@" << nextPos << (
d->currentIndex == idx ?
"current" :
"") <<
"items count was" <<
d->items.size();
2028 if (
d->items.contains(
item)) {
2029 d->releaseItem(
item);
2032 if (
d->currentIndex == idx) {
2033 currentVisible =
true;
2034 d->currentItemOffset = nextPos;
2036 d->items.append(
item);
2037 d->updateItem(
item, nextPos);
2041 if (idx >=
d->modelCount)
2043 nextPos =
d->positionOfIndex(idx);
2047 idx = (wasEmpty ?
d->calcCurrentIndex() : startIdx) - 1;
2050 idx =
d->modelCount - 1;
2051 nextPos =
d->positionOfIndex(idx);
2052 while (!waiting &&
d->isInBound(nextPos,
d->mappedRange -
d->mappedCache, startPos)
2053 &&
d->items.size() <
count+
d->cacheSize) {
2054 qCDebug(lcItemViewDelegateLifecycle) <<
"prepend" << idx <<
"@" << nextPos << (
d->currentIndex == idx ?
"current" :
"") <<
"items count was" <<
d->items.size();
2060 if (
d->items.contains(
item)) {
2061 d->releaseItem(
item);
2064 if (
d->currentIndex == idx) {
2065 currentVisible =
true;
2066 d->currentItemOffset = nextPos;
2068 d->items.prepend(
item);
2069 d->updateItem(
item, nextPos);
2074 idx =
d->modelCount - 1;
2075 nextPos =
d->positionOfIndex(idx);
2082 if (!waiting &&
d->items.size() <
count+
d->cacheSize) {
2083 qCDebug(lcItemViewDelegateLifecycle) <<
"Checking for pathview middle inserts, items count was" <<
d->items.size();
2086 while (idx != endIdx) {
2087 nextPos =
d->positionOfIndex(idx);
2088 if (
d->isInBound(nextPos,
d->mappedRange -
d->mappedCache, 1 +
d->mappedCache)) {
2096 if (!
d->items.contains(
item)) {
2097 qCDebug(lcItemViewDelegateLifecycle) <<
"middle insert" << idx <<
"@" << nextPos
2098 << (
d->currentIndex == idx ?
"current" :
"")
2099 <<
"items count was" <<
d->items.size();
2100 if (
d->currentIndex == idx) {
2101 currentVisible =
true;
2102 d->currentItemOffset = nextPos;
2104 int lastListIdx =
d->items.indexOf(lastItem);
2105 d->items.insert(lastListIdx + 1,
item);
2106 d->updateItem(
item, nextPos);
2108 d->releaseItem(
item);
2115 if (idx >=
d->modelCount)
2122 bool currentChanged =
false;
2123 if (!currentVisible) {
2124 d->currentItemOffset = 1;
2125 if (
d->currentItem) {
2126 d->updateItem(
d->currentItem, 1);
2127 }
else if (!waiting &&
d->currentIndex >= 0 &&
d->currentIndex <
d->modelCount) {
2128 if ((
d->currentItem =
d->getItem(
d->currentIndex,
d->currentIndex))) {
2129 currentChanged =
true;
2130 d->updateItem(
d->currentItem, 1);
2135 }
else if (!waiting && !
d->currentItem) {
2136 if ((
d->currentItem =
d->getItem(
d->currentIndex,
d->currentIndex))) {
2137 currentChanged =
true;
2138 d->currentItem->setFocus(
true);
2145 d->updateItem(
d->highlightItem,
d->highlightRangeStart);
2149 d->updateItem(
d->highlightItem,
d->currentItemOffset);
2154 d->releaseItem(
item);
2155 d->itemCache.clear();
2157 d->inRefill =
false;
2169 d->modelCount =
d->model->count();
2175 if (changeSet.
removes().isEmpty() && changeSet.
inserts().isEmpty())
2178 const int modelCount =
d->modelCount;
2181 bool currentChanged =
false;
2182 bool changedOffset =
false;
2184 if (moveId == -1 &&
d->currentIndex >=
r.index +
r.count) {
2185 d->currentIndex -=
r.count;
2186 currentChanged =
true;
2187 }
else if (moveId == -1 &&
d->currentIndex >=
r.index &&
d->currentIndex <
r.index +
r.count) {
2191 moveOffset =
d->currentIndex -
r.index;
2192 }
else if (
d->currentItem) {
2195 d->releaseItem(
d->currentItem);
2196 d->currentItem =
nullptr;
2198 d->currentIndex =
qMin(
r.index,
d->modelCount -
r.count - 1);
2199 currentChanged =
true;
2202 if (
r.index >
d->currentIndex) {
2203 changedOffset =
true;
2204 d->offset -=
r.count;
2205 d->offsetAdj -=
r.count;
2207 d->modelCount -=
r.count;
2210 if (
d->modelCount) {
2211 if (moveId == -1 &&
i.index <=
d->currentIndex) {
2212 d->currentIndex +=
i.count;
2213 currentChanged =
true;
2215 if (moveId != -1 && moveId ==
i.moveId) {
2216 d->currentIndex =
i.index + moveOffset;
2217 currentChanged =
true;
2219 if (
i.index >
d->currentIndex) {
2220 d->offset +=
i.count;
2221 d->offsetAdj +=
i.count;
2222 changedOffset =
true;
2226 d->modelCount +=
i.count;
2229 d->offset = std::fmod(
d->offset,
qreal(
d->modelCount));
2231 d->offset +=
d->modelCount;
2232 if (
d->currentIndex == -1)
2233 d->currentIndex =
d->calcCurrentIndex();
2235 d->itemCache +=
d->items;
2238 if (!
d->modelCount) {
2240 d->releaseItem(
item);
2241 d->itemCache.clear();
2243 changedOffset =
true;
2244 d->tl.reset(
d->moveOffset);
2247 d->offset = std::fmod(
qreal(
d->modelCount -
d->currentIndex),
qreal(
d->modelCount));
2248 changedOffset =
true;
2250 d->updateMappedRange();
2251 d->scheduleLayout();
2257 if (
d->modelCount != modelCount)
2266void QQuickPathView::ticked()
2272void QQuickPathView::movementEnding()
2276 d->flicking =
false;
2280 if (
d->moving && !
d->stealMouse) {
2285 d->moveDirection =
d->movementDirection;
2308 bool inItems =
false;
2351 emit q->currentIndexChanged();
2352 emit q->currentItemChanged();
2369 q->setCurrentIndex(curr);
2391 const qreal threshold = 0.5 / averageItemLength;
2425#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
Starts this timer.
bool isValid() const noexcept
Returns false if the timer has never been started or invalidated by a call to invalidate().
Type type() const
Returns the event type.
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.
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.
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and...
QEventPoint & point(qsizetype i)
Returns a QEventPoint reference for the point at index i.
QObject * exclusiveGrabber(const QEventPoint &point) const
Returns the object which has been set to receive all future update events and the release event conta...
virtual void setAccepted(bool accepted) override
\reimp
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.
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 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.
bool keepMouseGrab() const
Returns whether mouse input should exclusively remain with this item.
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
bool isInBound(qreal position, qreal lower, qreal upper) const
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
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
Returns a substring that contains the n leftmost characters of the string.
int startDragDistance
the distance, in pixels, that the mouse must be moved with a button held down before a drag and drop ...
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, bool createJSValueForObjectsAndSymbols, V4ObjectSet *visitedObjects)
std::uniform_real_distribution dist(1, 2.5)
[2]
settings setValue("DataPump/bgcolor", color)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent