Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickpathview_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKPATHVIEW_P_P_H
5#define QQUICKPATHVIEW_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qtquickglobal_p.h>
19
20QT_REQUIRE_CONFIG(quick_pathview);
21
22#include "qquickpathview_p.h"
23#include "qquickitem_p.h"
24
25#include <QtQml/qqml.h>
26#include <QtCore/qdatetime.h>
27#include <QtCore/qcoreapplication.h>
28
29#include <private/qquickanimation_p_p.h>
30#include <private/qqmldelegatemodel_p.h>
31#include <private/qquicktimeline_p_p.h>
32#include <private/qpodvector_p.h>
33
34#include <QtCore/qpointer.h>
35
37
41{
42 Q_DECLARE_PUBLIC(QQuickPathView)
43
44public:
46
47 void init();
48
50 if (change.sizeChange() && (!highlightItem || item != highlightItem)) {
52 att->m_percent = -1;
54 }
55 }
56
58 {
59 if (!items.removeOne(item))
61 }
62
64 Q_Q(QQuickPathView);
65 if (!layoutScheduled) {
66 layoutScheduled = true;
67 q->polish();
68 }
69 }
70
71 QQuickItem *getItem(int modelIndex, qreal z = 0, bool async=false);
75 void clear();
76 void updateMappedRange();
78 bool isInBound(qreal position, qreal lower, qreal upper, bool emptyRangeCheck = true) const;
79 void createHighlight();
80 void updateHighlight();
82 bool isValid() const {
83 return model && model->count() > 0 && model->isValid() && path;
84 }
85
89
90 int calcCurrentIndex();
91 void createCurrentItem();
92 void updateCurrent();
93 static void fixOffsetCallback(void*);
94 void fixOffset();
97 void regenerate();
100 void snapToIndex(int index, MovementReason reason);
101 QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const;
103 qreal calcVelocity() const;
105 void setDragging(bool d);
106
109 QPointer<QQuickItem> currentItem;
118 bool stealMouse : 1;
119 bool ownModel : 1;
120 bool interactive : 1;
123 bool highlightUp : 1;
125 bool moving : 1;
126 bool flicking : 1;
127 bool dragging : 1;
128 bool inRequest : 1;
130 bool inRefill : 1;
138 QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveOffset;
145 QList<QQuickItem *> items;
146 QList<QQuickItem *> itemCache;
147 QPointer<QQmlInstanceModel> model;
155 QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveHighlight;
162 QPODVector<qreal,10> velocityBuffer;
164};
165
167
168#endif
\inmodule QtCore
\inmodule QtGui
Definition qevent.h:49
bool removeOne(const AT &t)
Definition qlist.h:598
\inmodule QtGui
Definition qevent.h:196
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QQmlComponent class encapsulates a QML component definition.
virtual bool isValid() const =0
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
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
void handleMouseReleaseEvent(QMouseEvent *)
QPointer< QQuickItem > currentItem
QQmlComponent * highlightComponent
void setAdjustedOffset(qreal offset)
QQuickTimeLineValueProxy< QQuickPathViewPrivate > moveHighlight
QQuickPathView::MovementDirection movementDirection
void setHighlightPosition(qreal pos)
QQuickTimeLineValueProxy< QQuickPathViewPrivate > moveOffset
void handleMouseMoveEvent(QMouseEvent *event)
QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const
void setOffset(qreal offset)
QQmlOpenMetaObjectType * attachedType()
void itemDestroyed(QQuickItem *item) override
qreal positionOfIndex(qreal index) const
QQuickItem * getItem(int modelIndex, qreal z=0, bool async=false)
QList< QQuickItem * > itemCache
QQuickPathView::SnapMode snapMode
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override
QQuickPathView::HighlightRangeMode highlightRangeMode
void addVelocitySample(qreal v)
QQuickPathView::MovementDirection moveDirection
QQuickPathViewAttached * attached(QQuickItem *item)
QList< QQuickItem * > items
bool isInBound(qreal position, qreal lower, qreal upper, bool emptyRangeCheck=true) const
static void fixOffsetCallback(void *)
The QQuickTimeLine class provides a timeline for controlling animations.
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLuint index
[2]
GLenum GLuint GLintptr offset
struct _cl_event * event
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_REQUIRE_CONFIG(feature)
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QGraphicsItem * item