Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickrectangle_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
4 | ** Contact: https://www.qt.io/licensing/ | - |
5 | ** | - |
6 | ** This file is part of the QtQuick module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
15 | ** information use the contact form at https://www.qt.io/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 3 as published by the Free Software | - |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
21 | ** packaging of this file. Please review the following information to | - |
22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
24 | ** | - |
25 | ** GNU General Public License Usage | - |
26 | ** Alternatively, this file may be used under the terms of the GNU | - |
27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
28 | ** Public license version 3 or any later version approved by the KDE Free | - |
29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
31 | ** included in the packaging of this file. Please review the following | - |
32 | ** information to ensure the GNU General Public License requirements will | - |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
35 | ** | - |
36 | ** $QT_END_LICENSE$ | - |
37 | ** | - |
38 | ****************************************************************************/ | - |
39 | - | |
40 | #ifndef QQUICKRECTANGLE_P_H | - |
41 | #define QQUICKRECTANGLE_P_H | - |
42 | - | |
43 | // | - |
44 | // W A R N I N G | - |
45 | // ------------- | - |
46 | // | - |
47 | // This file is not part of the Qt API. It exists purely as an | - |
48 | // implementation detail. This header file may change from version to | - |
49 | // version without notice, or even be removed. | - |
50 | // | - |
51 | // We mean it. | - |
52 | // | - |
53 | - | |
54 | #include "qquickitem.h" | - |
55 | - | |
56 | #include <QtGui/qbrush.h> | - |
57 | - | |
58 | #include <private/qtquickglobal_p.h> | - |
59 | - | |
60 | QT_BEGIN_NAMESPACE | - |
61 | - | |
62 | class Q_QUICK_PRIVATE_EXPORT QQuickPen : public QObject | - |
63 | { | - |
64 | Q_OBJECT | - |
65 | - | |
66 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY penChanged) | - |
67 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY penChanged) | - |
68 | Q_PROPERTY(bool pixelAligned READ pixelAligned WRITE setPixelAligned NOTIFY penChanged) | - |
69 | public: | - |
70 | QQuickPen(QObject *parent=nullptr); | - |
71 | - | |
72 | qreal width() const; | - |
73 | void setWidth(qreal w); | - |
74 | - | |
75 | QColor color() const; | - |
76 | void setColor(const QColor &c); | - |
77 | - | |
78 | bool pixelAligned() const; | - |
79 | void setPixelAligned(bool aligned); | - |
80 | - | |
81 | bool isValid() const; | - |
82 | - | |
83 | Q_SIGNALS: | - |
84 | void penChanged(); | - |
85 | - | |
86 | private: | - |
87 | qreal m_width; | - |
88 | QColor m_color; | - |
89 | bool m_aligned : 1; | - |
90 | bool m_valid : 1; | - |
91 | }; | - |
92 | - | |
93 | class Q_QUICK_PRIVATE_EXPORT QQuickGradientStop : public QObject | - |
94 | { | - |
95 | Q_OBJECT | - |
96 | - | |
97 | Q_PROPERTY(qreal position READ position WRITE setPosition) | - |
98 | Q_PROPERTY(QColor color READ color WRITE setColor) | - |
99 | - | |
100 | public: | - |
101 | QQuickGradientStop(QObject *parent=nullptr); | - |
102 | - | |
103 | qreal position() const; | - |
104 | void setPosition(qreal position); | - |
105 | - | |
106 | QColor color() const; | - |
107 | void setColor(const QColor &color); | - |
108 | - | |
109 | private: | - |
110 | void updateGradient(); | - |
111 | - | |
112 | private: | - |
113 | qreal m_position; | - |
114 | QColor m_color; | - |
115 | }; | - |
116 | - | |
117 | class Q_QUICK_PRIVATE_EXPORT QQuickGradient : public QObject | - |
118 | { | - |
119 | Q_OBJECT | - |
120 | - | |
121 | Q_PROPERTY(QQmlListProperty<QQuickGradientStop> stops READ stops) | - |
122 | Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged REVISION 12) | - |
123 | Q_CLASSINFO("DefaultProperty", "stops") | - |
124 | - | |
125 | public: | - |
126 | QQuickGradient(QObject *parent=nullptr); | - |
127 | ~QQuickGradient() override; | - |
128 | - | |
129 | enum Orientation { Vertical = Qt::Vertical, | - |
130 | Horizontal = Qt::Horizontal }; | - |
131 | Q_ENUM(Orientation) | - |
132 | - | |
133 | QQmlListProperty<QQuickGradientStop> stops(); | - |
134 | - | |
135 | Orientation orientation() const { return m_orientation; } executed 535 times by 6 tests: return m_orientation; Executed by:
| 535 |
136 | void setOrientation(Orientation orientation); | - |
137 | - | |
138 | QGradientStops gradientStops() const; | - |
139 | - | |
140 | Q_SIGNALS: | - |
141 | void updated(); | - |
142 | void orientationChanged(); | - |
143 | - | |
144 | private: | - |
145 | void doUpdate(); | - |
146 | - | |
147 | private: | - |
148 | QList<QQuickGradientStop *> m_stops; | - |
149 | Orientation m_orientation = Vertical; | - |
150 | friend class QQuickRectangle; | - |
151 | friend class QQuickGradientStop; | - |
152 | }; | - |
153 | - | |
154 | class QQuickRectanglePrivate; | - |
155 | class Q_QUICK_PRIVATE_EXPORT QQuickRectangle : public QQuickItem | - |
156 | { | - |
157 | Q_OBJECT | - |
158 | - | |
159 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | - |
160 | Q_PROPERTY(QQuickGradient *gradient READ gradient WRITE setGradient RESET resetGradient) | - |
161 | Q_PROPERTY(QQuickPen * border READ border CONSTANT) | - |
162 | Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) | - |
163 | public: | - |
164 | QQuickRectangle(QQuickItem *parent=nullptr); | - |
165 | - | |
166 | QColor color() const; | - |
167 | void setColor(const QColor &); | - |
168 | - | |
169 | QQuickPen *border(); | - |
170 | - | |
171 | QQuickGradient *gradient() const; | - |
172 | void setGradient(QQuickGradient *gradient); | - |
173 | void resetGradient(); | - |
174 | - | |
175 | qreal radius() const; | - |
176 | void setRadius(qreal radius); | - |
177 | - | |
178 | Q_SIGNALS: | - |
179 | void colorChanged(); | - |
180 | void radiusChanged(); | - |
181 | - | |
182 | protected: | - |
183 | QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; | - |
184 | - | |
185 | private Q_SLOTS: | - |
186 | void doUpdate(); | - |
187 | - | |
188 | private: | - |
189 | Q_DISABLE_COPY(QQuickRectangle) | - |
190 | Q_DECLARE_PRIVATE(QQuickRectangle) executed 229753 times by 81 tests: return reinterpret_cast<QQuickRectanglePrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 5190 times by 19 tests: return reinterpret_cast<const QQuickRectanglePrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 5190-229753 |
191 | }; | - |
192 | - | |
193 | QT_END_NAMESPACE | - |
194 | - | |
195 | QML_DECLARE_TYPE(QQuickPen) | - |
196 | QML_DECLARE_TYPE(QQuickGradientStop) | - |
197 | QML_DECLARE_TYPE(QQuickGradient) | - |
198 | QML_DECLARE_TYPE(QQuickRectangle) | - |
199 | - | |
200 | #endif // QQUICKRECTANGLE_P_H | - |
Source code | Switch to Preprocessed file |