Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qquickpath_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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QQUICKPATH_P_H
6
#
define
QQUICKPATH_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
private
/
qtquickglobal_p
.
h
>
20
21
QT_REQUIRE_CONFIG
(
quick_path
);
22
23
#
include
"qquickpath_p.h"
24
25
#
include
<
qqml
.
h
>
26
#
include
<
QtCore
/
QStringList
>
27
28
#
include
<
private
/
qobject_p
.
h
>
29
30
QT_BEGIN_NAMESPACE
31
32
class
Q_QUICK_EXPORT
QQuickPathPrivate
:
public
QObjectPrivate
33
{
34
Q_DECLARE_PUBLIC(QQuickPath)
35
36
public
:
37
static
QQuickPathPrivate* get(QQuickPath *path) {
return
path->d_func(); }
38
static
const
QQuickPathPrivate* get(
const
QQuickPath *path) {
return
path->d_func(); }
39
40
QQuickPathPrivate()
41
: componentComplete(
true
), isShapePath(
false
), simplify(
false
)
42
, processPending(
false
), asynchronous(
false
), useCustomPath(
false
)
43
{}
44
45
enum
class
ProcessPathPolicy {
46
DontProcess,
47
Process
48
};
49
void
appendPathElement(QQuickPathElement *pathElement,
50
ProcessPathPolicy processPathPolicy = ProcessPathPolicy::Process)
51
{
52
if
(pathElement && componentComplete) {
53
enablePathElement(pathElement);
54
_pathElements.append(pathElement);
55
if
(processPathPolicy == ProcessPathPolicy::Process)
56
q_func()->processPath();
57
}
else
{
58
_pathElements.append(pathElement);
59
}
60
}
61
62
void
removeLastPathElement()
63
{
64
QQuickPathElement *pathElement = _pathElements.takeLast();
65
if
(pathElement && componentComplete) {
66
disablePathElement(pathElement);
67
q_func()->processPath();
68
}
69
}
70
71
void
replacePathElement(qsizetype position, QQuickPathElement *pathElement)
72
{
73
if
(position >= _pathElements.length())
74
_pathElements.resize(position + 1,
nullptr
);
75
76
if
(!componentComplete) {
77
_pathElements[position] = pathElement;
78
return
;
79
}
80
81
bool
changed =
false
;
82
83
QQuickPathElement *oldElement = _pathElements.at(position);
84
if
(oldElement == pathElement)
85
return
;
86
87
if
(oldElement) {
88
disablePathElement(oldElement);
89
changed =
true
;
90
}
91
92
if
(pathElement) {
93
enablePathElement(pathElement);
94
changed =
true
;
95
}
96
97
_pathElements[position] = pathElement;
98
99
if
(changed)
100
q_func()->processPath();
101
}
102
103
enum
class
DeleteElementPolicy {
104
DontDelete,
105
Delete
106
};
107
void
clearPathElements(DeleteElementPolicy deleteElementPolicy
108
= QQuickPathPrivate::DeleteElementPolicy::DontDelete)
109
{
110
Q_Q(QQuickPath);
111
q->disconnectPathElements();
112
if
(deleteElementPolicy == DeleteElementPolicy::Delete)
113
qDeleteAll(_pathElements);
114
_pathElements.clear();
115
_pathCurves.clear();
116
_pointCache.clear();
117
_pathTexts.clear();
118
_path.clear();
119
emit q->changed();
120
}
121
122
QPainterPath _path;
123
QList<QQuickPathElement*> _pathElements;
124
mutable
QList<QPointF> _pointCache;
125
QList<QQuickPath::AttributePoint> _attributePoints;
126
QStringList _attributes;
127
QList<QQuickCurve*> _pathCurves;
128
QList<QQuickPathText*> _pathTexts;
129
mutable
QQuickCachedBezier prevBez;
130
QQmlNullableValue<qreal> startX;
131
QQmlNullableValue<qreal> startY;
132
qreal pathLength = 0;
133
QSizeF scale = QSizeF(1, 1);
134
bool
closed =
false
;
135
bool
componentComplete : 1;
136
bool
isShapePath : 1;
137
bool
simplify : 1;
138
bool
processPending : 1;
139
bool
asynchronous : 1;
140
bool
useCustomPath : 1;
141
142
private
:
143
void
enablePathElement(QQuickPathElement *pathElement);
144
void
disablePathElement(QQuickPathElement *pathElement);
145
};
146
147
QT_END_NAMESPACE
148
149
#
endif
QQuickCurve
Definition
qquickpath_p.h:87
QQuickPathAngleArc
Definition
qquickpath_p.h:329
QQuickPathArc
Definition
qquickpath_p.h:279
QQuickPathAttribute
\qmltype PathAttribute \nativetype QQuickPathAttribute \inqmlmodule QtQuick
Definition
qquickpath_p.h:60
QQuickPathCatmullRomCurve
Definition
qquickpath_p.h:268
QQuickPathCubic
Definition
qquickpath_p.h:200
QQuickPathElement
Definition
qquickpath_p.h:49
QQuickPathLine
Definition
qquickpath_p.h:135
QQuickPathMove
Definition
qquickpath_p.h:146
QQuickPathMultiline
Definition
qquickpath_p.h:632
QQuickPathPercent
Definition
qquickpath_p.h:589
QQuickPathPolyline
Definition
qquickpath_p.h:608
QQuickPathPrivate
Definition
qquickpath_p_p.h:33
QQuickPathQuad
\qmltype PathQuad \nativetype QQuickPathQuad \inqmlmodule QtQuick
Definition
qquickpath_p.h:157
QQuickPathRectangle
Definition
qquickpath_p.h:410
QQuickPathSvg
Definition
qquickpath_p.h:389
QQuickPathText
Definition
qquickpath_p.h:784
QQuickPath
Definition
qquickpath_p.h:670
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(animation)
operator<<
QDebug operator<<(QDebug debug, const QQuickCurve *curve)
Definition
qquickpath.cpp:1179
slopeAt
static qreal slopeAt(qreal t, qreal a, qreal b, qreal c, qreal d)
Definition
qquickpath.cpp:751
privatePath
static QQuickPathPrivate * privatePath(QObject *object)
Definition
qquickpath.cpp:293
segmentCount
static int segmentCount(const QPainterPath &path, qreal pathLength)
Definition
qquickpath.cpp:736
positionForCurve
QPointF positionForCurve(const QQuickPathData &data, const QPointF &prevPoint)
\qmltype PathLine \nativetype QQuickPathLine \inqmlmodule QtQuick
Definition
qquickpath.cpp:1365
previousPathPosition
QPointF previousPathPosition(const QPainterPath &path)
\qmltype PathCurve \nativetype QQuickPathCatmullRomCurve \inqmlmodule QtQuick
Definition
qquickpath.cpp:1866
nextBezier
static QBezier nextBezier(const QPainterPath &path, int *current, qreal *bezLength, bool reverse=false)
Definition
qquickpath.cpp:698
scalePath
static void scalePath(QPainterPath &path, const QSizeF &scale)
Definition
qquickpath.cpp:450
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(quick_path)
QQuickCachedBezier
Definition
qquickpath_p.h:658
QQuickCachedBezier::isValid
bool isValid
Definition
qquickpath_p.h:665
QQuickCachedBezier::QQuickCachedBezier
QQuickCachedBezier()
Definition
qquickpath_p.h:659
QQuickCachedBezier::bezier
QBezier bezier
Definition
qquickpath_p.h:660
QQuickCachedBezier::bezLength
qreal bezLength
Definition
qquickpath_p.h:662
QQuickCachedBezier::element
int element
Definition
qquickpath_p.h:661
QQuickCachedBezier::currLength
qreal currLength
Definition
qquickpath_p.h:663
QQuickCachedBezier::p
qreal p
Definition
qquickpath_p.h:664
QQuickPathData
Definition
qquickpath_p.h:42
QQuickPathData::index
int index
Definition
qquickpath_p.h:43
QQuickPathData::endPoint
QPointF endPoint
Definition
qquickpath_p.h:44
QQuickPathData::curves
QList< QQuickCurve * > curves
Definition
qquickpath_p.h:45
qtdeclarative
src
quick
util
qquickpath_p_p.h
Generated on
for Qt by
1.18.0