OpenCoverage

qquickrectangle.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickrectangle.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
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#include "qquickrectangle_p.h"-
41#include "qquickrectangle_p_p.h"-
42-
43#include <QtQuick/private/qsgcontext_p.h>-
44#include <private/qsgadaptationlayer_p.h>-
45-
46#include <QtGui/qpixmapcache.h>-
47#include <QtCore/qmath.h>-
48#include <QtCore/qmetaobject.h>-
49-
50QT_BEGIN_NAMESPACE-
51-
52// XXX todo - should we change rectangle to draw entirely within its width/height?-
53/*!-
54 \internal-
55 \class QQuickPen-
56 \brief For specifying a pen used for drawing rectangle borders on a QQuickView-
57-
58 By default, the pen is invalid and nothing is drawn. You must either set a color (then the default-
59 width is 1) or a width (then the default color is black).-
60-
61 A width of 1 indicates is a single-pixel line on the border of the item being painted.-
62-
63 Example:-
64 \qml-
65 Rectangle {-
66 border.width: 2-
67 border.color: "red"-
68 }-
69 \endqml-
70*/-
71-
72QQuickPen::QQuickPen(QObject *parent)-
73 : QObject(parent)-
74 , m_width(1)-
75 , m_color(Qt::black)-
76 , m_aligned(true)-
77 , m_valid(false)-
78{-
79}
executed 53997 times by 22 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
53997
80-
81qreal QQuickPen::width() const-
82{-
83 return m_width;
executed 44924 times by 20 tests: return m_width;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
44924
84}-
85-
86void QQuickPen::setWidth(qreal w)-
87{-
88 if (m_width == w && m_valid)
m_width == wDescription
TRUEevaluated 44038 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlcomponent
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
FALSEevaluated 1152 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktextedit
m_validDescription
TRUEevaluated 2022 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmlcomponent
  • tst_qquicklistview
FALSEevaluated 42016 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
1152-44038
89 return;
executed 2022 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qqmlcomponent
  • tst_qquicklistview
2022
90-
91 m_width = w;-
92 m_valid = m_color.alpha() && (qRound(m_width) >= 1 || (!m_aligned && m_width > 0));
m_color.alpha()Description
TRUEevaluated 43168 times by 20 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
qRound(m_width) >= 1Description
TRUEevaluated 43164 times by 20 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
!m_alignedDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
m_width > 0Description
TRUEnever evaluated
FALSEnever evaluated
0-43168
93 static_cast<QQuickItem*>(parent())->update();-
94 emit penChanged();-
95}
executed 43168 times by 20 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
43168
96-
97QColor QQuickPen::color() const-
98{-
99 return m_color;
executed 44838 times by 17 tests: return m_color;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
44838
100}-
101-
102void QQuickPen::setColor(const QColor &c)-
103{-
104 m_color = c;-
105 m_valid = m_color.alpha() && (qRound(m_width) >= 1 || (!m_aligned && m_width > 0));
m_color.alpha()Description
TRUEevaluated 12275 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 272 times by 2 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickmultipointtoucharea
qRound(m_width) >= 1Description
TRUEevaluated 12275 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
!m_alignedDescription
TRUEnever evaluated
FALSEnever evaluated
m_width > 0Description
TRUEnever evaluated
FALSEnever evaluated
0-12275
106 static_cast<QQuickItem*>(parent())->update();-
107 emit penChanged();-
108}
executed 12547 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
12547
109-
110bool QQuickPen::pixelAligned() const-
111{-
112 return m_aligned;
executed 44269 times by 16 tests: return m_aligned;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
44269
113}-
114-
115void QQuickPen::setPixelAligned(bool aligned)-
116{-
117 if (aligned == m_aligned)
aligned == m_alignedDescription
TRUEnever evaluated
FALSEnever evaluated
0
118 return;
never executed: return;
0
119 m_aligned = aligned;-
120 m_valid = m_color.alpha() && (qRound(m_width) >= 1 || (!m_aligned && m_width > 0));
m_color.alpha()Description
TRUEnever evaluated
FALSEnever evaluated
qRound(m_width) >= 1Description
TRUEnever evaluated
FALSEnever evaluated
!m_alignedDescription
TRUEnever evaluated
FALSEnever evaluated
m_width > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
121 static_cast<QQuickItem*>(parent())->update();-
122 emit penChanged();-
123}
never executed: end of block
0
124-
125bool QQuickPen::isValid() const-
126{-
127 return m_valid;
executed 44519 times by 15 tests: return m_valid;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
44519
128}-
129-
130/*!-
131 \qmltype GradientStop-
132 \instantiates QQuickGradientStop-
133 \inqmlmodule QtQuick-
134 \ingroup qtquick-visual-utility-
135 \brief Defines the color at a position in a Gradient.-
136-
137 \sa Gradient-
138*/-
139-
140/*!-
141 \qmlproperty real QtQuick::GradientStop::position-
142 \qmlproperty color QtQuick::GradientStop::color-
143-
144 The position and color properties describe the color used at a given-
145 position in a gradient, as represented by a gradient stop.-
146-
147 The default position is 0.0; the default color is black.-
148-
149 \sa Gradient-
150*/-
151QQuickGradientStop::QQuickGradientStop(QObject *parent)-
152 : QObject(parent)-
153{-
154}
executed 1310 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
1310
155-
156qreal QQuickGradientStop::position() const-
157{-
158 return m_position;
executed 2258 times by 7 tests: return m_position;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
2258
159}-
160-
161void QQuickGradientStop::setPosition(qreal position)-
162{-
163 m_position = position; updateGradient();-
164}
executed 1312 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
1312
165-
166QColor QQuickGradientStop::color() const-
167{-
168 return m_color;
executed 1396 times by 7 tests: return m_color;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
1396
169}-
170-
171void QQuickGradientStop::setColor(const QColor &color)-
172{-
173 m_color = color; updateGradient();-
174}
executed 1630 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
1630
175-
176void QQuickGradientStop::updateGradient()-
177{-
178 if (QQuickGradient *grad = qobject_cast<QQuickGradient*>(parent()))
QQuickGradient...nt*>(parent())Description
TRUEevaluated 2942 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEnever evaluated
0-2942
179 grad->doUpdate();
executed 2942 times by 7 tests: grad->doUpdate();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
2942
180}
executed 2942 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
2942
181-
182/*!-
183 \qmltype Gradient-
184 \instantiates QQuickGradient-
185 \inqmlmodule QtQuick-
186 \ingroup qtquick-visual-utility-
187 \brief Defines a gradient fill.-
188-
189 A gradient is defined by two or more colors, which will be blended seamlessly.-
190-
191 The colors are specified as a set of GradientStop child items, each of-
192 which defines a position on the gradient from 0.0 to 1.0 and a color.-
193 The position of each GradientStop is defined by setting its-
194 \l{GradientStop::}{position} property; its color is defined using its-
195 \l{GradientStop::}{color} property.-
196-
197 A gradient without any gradient stops is rendered as a solid white fill.-
198-
199 Note that this item is not a visual representation of a gradient. To display a-
200 gradient, use a visual item (like \l Rectangle) which supports the use-
201 of gradients.-
202-
203 \section1 Example Usage-
204-
205 \div {class="float-right"}-
206 \inlineimage qml-gradient.png-
207 \enddiv-
208-
209 The following example declares a \l Rectangle item with a gradient starting-
210 with red, blending to yellow at one third of the height of the rectangle,-
211 and ending with green:-
212-
213 \snippet qml/gradient.qml code-
214-
215 \clearfloat-
216 \section1 Performance and Limitations-
217-
218 Calculating gradients can be computationally expensive compared to the use-
219 of solid color fills or images. Consider using gradients for static items-
220 in a user interface.-
221-
222 Since Qt 5.12, vertical and horizontal linear gradients can be applied to items.-
223 If you need to apply angled gradients, a combination of rotation and clipping-
224 can be applied to the relevant items. Alternatively, consider using-
225 QtQuick.Shapes::LinearGradient or QtGraphicalEffects::LinearGradient. These-
226 approaches can all introduce additional performance requirements for your application.-
227-
228 The use of animations involving gradient stops may not give the desired-
229 result. An alternative way to animate gradients is to use pre-generated-
230 images or SVG drawings containing gradients.-
231-
232 \sa GradientStop-
233*/-
234-
235/*!-
236 \qmlproperty list<GradientStop> QtQuick::Gradient::stops-
237 \default-
238-
239 This property holds the gradient stops describing the gradient.-
240-
241 By default, this property contains an empty list.-
242-
243 To set the gradient stops, define them as children of the Gradient.-
244*/-
245QQuickGradient::QQuickGradient(QObject *parent)-
246: QObject(parent)-
247{-
248}
executed 604 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
604
249-
250QQuickGradient::~QQuickGradient()-
251{-
252}-
253-
254QQmlListProperty<QQuickGradientStop> QQuickGradient::stops()-
255{-
256 return QQmlListProperty<QQuickGradientStop>(this, m_stops);
executed 588 times by 7 tests: return QQmlListProperty<QQuickGradientStop>(this, m_stops);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
588
257}-
258-
259/*!-
260 \qmlproperty enumeration QtQuick::Gradient::orientation-
261 \since 5.12-
262-
263 Set this property to define the direction of the gradient.-
264 \list-
265 \li Gradient.Vertical - a vertical gradient-
266 \li Gradient.Horizontal - a horizontal gradient-
267 \endlist-
268-
269 The default is Gradient.Vertical.-
270*/-
271void QQuickGradient::setOrientation(Orientation orientation)-
272{-
273 if (m_orientation == orientation)
m_orientation == orientationDescription
TRUEnever evaluated
FALSEnever evaluated
0
274 return;
never executed: return;
0
275-
276 m_orientation = orientation;-
277 emit orientationChanged();-
278 emit updated();-
279}
never executed: end of block
0
280-
281QGradientStops QQuickGradient::gradientStops() const-
282{-
283 QGradientStops stops;-
284 for (int i = 0; i < m_stops.size(); ++i){
i < m_stops.size()Description
TRUEevaluated 1252 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 562 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
562-1252
285 int j = 0;-
286 while (j < stops.size() && stops.at(j).first < m_stops[i]->position())
j < stops.size()Description
TRUEevaluated 1002 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 1250 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
stops.at(j).fi...i]->position()Description
TRUEevaluated 1000 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
2-1250
287 j++;
executed 1000 times by 7 tests: j++;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
1000
288 stops.insert(j, QGradientStop(m_stops.at(i)->position(), m_stops.at(i)->color()));-
289 }
executed 1252 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
1252
290 return stops;
executed 562 times by 7 tests: return stops;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
562
291}-
292-
293void QQuickGradient::doUpdate()-
294{-
295 emit updated();-
296}
executed 2942 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquickshape
  • tst_qquicktaphandler
  • tst_scenegraph
2942
297-
298int QQuickRectanglePrivate::doUpdateSlotIdx = -1;-
299-
300/*!-
301 \qmltype Rectangle-
302 \instantiates QQuickRectangle-
303 \inqmlmodule QtQuick-
304 \inherits Item-
305 \ingroup qtquick-visual-
306 \brief Paints a filled rectangle with an optional border.-
307-
308 Rectangle items are used to fill areas with solid color or gradients, and/or-
309 to provide a rectangular border.-
310-
311 \section1 Appearance-
312-
313 Each Rectangle item is painted using either a solid fill color, specified using-
314 the \l color property, or a gradient, defined using a Gradient type and set-
315 using the \l gradient property. If both a color and a gradient are specified,-
316 the gradient is used.-
317-
318 You can add an optional border to a rectangle with its own color and thickness-
319 by setting the \l border.color and \l border.width properties. Set the color-
320 to "transparent" to paint a border without a fill color.-
321-
322 You can also create rounded rectangles using the \l radius property. Since this-
323 introduces curved edges to the corners of a rectangle, it may be appropriate to-
324 set the \l Item::antialiasing property to improve its appearance.-
325-
326 \section1 Example Usage-
327-
328 \div {class="float-right"}-
329 \inlineimage declarative-rect.png-
330 \enddiv-
331-
332 The following example shows the effects of some of the common properties on a-
333 Rectangle item, which in this case is used to create a square:-
334-
335 \snippet qml/rectangle/rectangle.qml document-
336-
337 \clearfloat-
338 \section1 Performance-
339-
340 Using the \l Item::antialiasing property improves the appearance of a rounded rectangle at-
341 the cost of rendering performance. You should consider unsetting this property-
342 for rectangles in motion, and only set it when they are stationary.-
343-
344 \sa Image-
345*/-
346-
347QQuickRectangle::QQuickRectangle(QQuickItem *parent)-
348: QQuickItem(*(new QQuickRectanglePrivate), parent)-
349{-
350 setFlag(ItemHasContents);-
351#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)-
352 setAcceptTouchEvents(false);-
353#endif-
354}
executed 94806 times by 86 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • ...
94806
355-
356void QQuickRectangle::doUpdate()-
357{-
358 update();-
359}
executed 754 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquicktaphandler
754
360-
361/*!-
362 \qmlproperty bool QtQuick::Rectangle::antialiasing-
363-
364 Used to decide if the Rectangle should use antialiasing or not.-
365 \l {Antialiasing} provides information on the performance implications-
366 of this property.-
367-
368 The default is true for Rectangles with a radius, and false otherwise.-
369*/-
370-
371/*!-
372 \qmlpropertygroup QtQuick::Rectangle::border-
373 \qmlproperty int QtQuick::Rectangle::border.width-
374 \qmlproperty color QtQuick::Rectangle::border.color-
375-
376 The width and color used to draw the border of the rectangle.-
377-
378 A width of 1 creates a thin line. For no line, use a width of 0 or a transparent color.-
379-
380 \note The width of the rectangle's border does not affect the geometry of the-
381 rectangle itself or its position relative to other items if anchors are used.-
382-
383 The border is rendered within the rectangle's boundaries.-
384*/-
385QQuickPen *QQuickRectangle::border()-
386{-
387 Q_D(QQuickRectangle);-
388 if (!d->pen) {
!d->penDescription
TRUEevaluated 53997 times by 22 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 100 times by 6 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickstates
100-53997
389 d->pen = new QQuickPen;-
390 QQml_setParent_noEvent(d->pen, this);-
391 }
executed 53997 times by 22 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
53997
392 return d->pen;
executed 54097 times by 22 tests: return d->pen;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
54097
393}-
394-
395/*!-
396 \qmlproperty Gradient QtQuick::Rectangle::gradient-
397-
398 The gradient to use to fill the rectangle.-
399-
400 This property allows for the construction of simple vertical or horizontal gradients.-
401 Other gradients may be formed by adding rotation to the rectangle.-
402-
403 \div {class="float-left"}-
404 \inlineimage declarative-rect_gradient.png-
405 \enddiv-
406-
407 \snippet qml/rectangle/rectangle-gradient.qml rectangles-
408 \clearfloat-
409-
410 If both a gradient and a color are specified, the gradient will be used.-
411-
412 \sa Gradient, color-
413*/-
414QQuickGradient *QQuickRectangle::gradient() const-
415{-
416 Q_D(const QQuickRectangle);-
417 return d->gradient;
executed 42 times by 3 tests: return d->gradient;
Executed by:
  • tst_qqmlenginedebugservice
  • tst_qquickdesignersupport
  • tst_qquickrectangle
42
418}-
419-
420void QQuickRectangle::setGradient(QQuickGradient *gradient)-
421{-
422 Q_D(QQuickRectangle);-
423 if (d->gradient == gradient)
d->gradient == gradientDescription
TRUEnever evaluated
FALSEevaluated 578 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
0-578
424 return;
never executed: return;
0
425 static int updatedSignalIdx = -1;-
426 if (updatedSignalIdx < 0)
updatedSignalIdx < 0Description
TRUEevaluated 14 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 564 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
14-564
427 updatedSignalIdx = QMetaMethod::fromSignal(&QQuickGradient::updated).methodIndex();
executed 14 times by 7 tests: updatedSignalIdx = QMetaMethod::fromSignal(&QQuickGradient::updated).methodIndex();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
14
428 if (d->doUpdateSlotIdx < 0)
d->doUpdateSlotIdx < 0Description
TRUEevaluated 14 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 564 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
14-564
429 d->doUpdateSlotIdx = QQuickRectangle::staticMetaObject.indexOfSlot("doUpdate()");
executed 14 times by 7 tests: d->doUpdateSlotIdx = QQuickRectangle::staticMetaObject.indexOfSlot("doUpdate()");
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
14
430 if (d->gradient)
d->gradientDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrectangle
FALSEevaluated 576 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
2-576
431 QMetaObject::disconnect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
executed 2 times by 1 test: QMetaObject::disconnect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
Executed by:
  • tst_qquickrectangle
2
432 d->gradient = gradient;-
433 if (d->gradient)
d->gradientDescription
TRUEevaluated 576 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickrectangle
2-576
434 QMetaObject::connect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
executed 576 times by 7 tests: QMetaObject::connect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
576
435 update();-
436}
executed 578 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdesignersupport
  • tst_qquickitemlayer
  • tst_qquickrectangle
  • tst_qquicktaphandler
  • tst_scenegraph
578
437-
438void QQuickRectangle::resetGradient()-
439{-
440 setGradient(nullptr);-
441}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickrectangle
2
442-
443/*!-
444 \qmlproperty real QtQuick::Rectangle::radius-
445 This property holds the corner radius used to draw a rounded rectangle.-
446-
447 If radius is non-zero, the rectangle will be painted as a rounded rectangle, otherwise it will be-
448 painted as a normal rectangle. The same radius is used by all 4 corners; there is currently-
449 no way to specify different radii for different corners.-
450*/-
451qreal QQuickRectangle::radius() const-
452{-
453 Q_D(const QQuickRectangle);-
454 return d->radius;
executed 4384 times by 5 tests: return d->radius;
Executed by:
  • tst_flickableinterop
  • tst_qqmlenginedebugservice
  • tst_qquickmultipointtoucharea
  • tst_qquickstates
  • tst_qquicktaphandler
4384
455}-
456-
457void QQuickRectangle::setRadius(qreal radius)-
458{-
459 Q_D(QQuickRectangle);-
460 if (d->radius == radius)
d->radius == radiusDescription
TRUEevaluated 388 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitem2
  • tst_qquicktaphandler
FALSEevaluated 2830 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
388-2830
461 return;
executed 388 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitem2
  • tst_qquicktaphandler
388
462-
463 d->radius = radius;-
464 d->setImplicitAntialiasing(radius != 0.0);-
465-
466 update();-
467 emit radiusChanged();-
468}
executed 2830 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpositioners
  • tst_qquickrectangle
  • tst_qquickstates
  • tst_qquicktaphandler
2830
469-
470/*!-
471 \qmlproperty color QtQuick::Rectangle::color-
472 This property holds the color used to fill the rectangle.-
473-
474 The default color is white.-
475-
476 \div {class="float-right"}-
477 \inlineimage rect-color.png-
478 \enddiv-
479-
480 The following example shows rectangles with colors specified-
481 using hexadecimal and named color notation:-
482-
483 \snippet qml/rectangle/rectangle-colors.qml rectangles-
484-
485 \clearfloat-
486 If both a gradient and a color are specified, the gradient will be used.-
487-
488 \sa gradient-
489*/-
490QColor QQuickRectangle::color() const-
491{-
492 Q_D(const QQuickRectangle);-
493 return d->color;
executed 764 times by 15 tests: return d->color;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdesignersupport
  • tst_qquickfocusscope
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickrepeater
  • tst_qquickstates
  • tst_scenegraph
764
494}-
495-
496void QQuickRectangle::setColor(const QColor &c)-
497{-
498 Q_D(QQuickRectangle);-
499 if (d->color == c)
d->color == cDescription
TRUEevaluated 55888 times by 27 tests
Evaluated by:
  • tst_examples
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickaccessible
  • tst_qquickanchors
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdesignersupport
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickrepeater
  • tst_qquickspritesequence
  • tst_qquickstates
  • tst_qquicktextedit
  • tst_qquicktextinput
  • ...
FALSEevaluated 36295 times by 77 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdraghandler
  • ...
36295-55888
500 return;
executed 55888 times by 27 tests: return;
Executed by:
  • tst_examples
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmllistmodel
  • tst_qquickaccessible
  • tst_qquickanchors
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdesignersupport
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickrepeater
  • tst_qquickspritesequence
  • tst_qquickstates
  • tst_qquicktextedit
  • tst_qquicktextinput
  • ...
55888
501-
502 d->color = c;-
503 update();-
504 emit colorChanged();-
505}
executed 36295 times by 77 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdraghandler
  • ...
36295
506-
507QSGNode *QQuickRectangle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)-
508{-
509 Q_UNUSED(data);-
510 Q_D(QQuickRectangle);-
511-
512 if (width() <= 0 || height() <= 0
width() <= 0Description
TRUEevaluated 840 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 78799 times by 66 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
height() <= 0Description
TRUEevaluated 100 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 78699 times by 66 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
100-78799
513 || (d->color.alpha() == 0 && (!d->pen || d->pen->width() == 0 || d->pen->color().alpha() == 0))) {
d->color.alpha() == 0Description
TRUEevaluated 2285 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquicktaphandler
  • tst_qquicktextedit
FALSEevaluated 76414 times by 66 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
!d->penDescription
TRUEevaluated 1720 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 565 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktaphandler
  • tst_qquicktextedit
d->pen->width() == 0Description
TRUEnever evaluated
FALSEevaluated 565 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktaphandler
  • tst_qquicktextedit
d->pen->color().alpha() == 0Description
TRUEnever evaluated
FALSEevaluated 565 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktaphandler
  • tst_qquicktextedit
0-76414
514 delete oldNode;-
515 return nullptr;
executed 2660 times by 10 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
2660
516 }-
517-
518 QSGInternalRectangleNode *rectangle = static_cast<QSGInternalRectangleNode *>(oldNode);-
519 if (!rectangle) rectangle = d->sceneGraphContext()->createInternalRectangleNode();
executed 71757 times by 66 tests: rectangle = d->sceneGraphContext()->createInternalRectangleNode();
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
!rectangleDescription
TRUEevaluated 71757 times by 66 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
FALSEevaluated 5222 times by 18 tests
Evaluated by:
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickanimationcontroller
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextinput
  • tst_qquickwidget
  • tst_scenegraph
5222-71757
520-
521 rectangle->setRect(QRectF(0, 0, width(), height()));-
522 rectangle->setColor(d->color);-
523-
524 if (d->pen && d->pen->isValid()) {
d->penDescription
TRUEevaluated 44519 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 32460 times by 65 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
d->pen->isValid()Description
TRUEevaluated 44265 times by 15 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickmultipointtoucharea
254-44519
525 rectangle->setPenColor(d->pen->color());-
526 rectangle->setPenWidth(d->pen->width());-
527 rectangle->setAligned(d->pen->pixelAligned());-
528 } else {
executed 44265 times by 15 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
44265
529 rectangle->setPenWidth(0);-
530 }
executed 32714 times by 65 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
32714
531-
532 rectangle->setRadius(d->radius);-
533 rectangle->setAntialiasing(antialiasing());-
534-
535 QGradientStops stops;-
536 bool vertical = true;-
537 if (d->gradient) {
d->gradientDescription
TRUEevaluated 533 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquicktaphandler
  • tst_scenegraph
FALSEevaluated 76446 times by 66 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
533-76446
538 stops = d->gradient->gradientStops();-
539 vertical = d->gradient->orientation() == QQuickGradient::Vertical;-
540 }
executed 533 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickitemlayer
  • tst_qquicktaphandler
  • tst_scenegraph
533
541 rectangle->setGradientStops(stops);-
542 rectangle->setGradientVertical(vertical);-
543-
544 rectangle->update();-
545-
546 return rectangle;
executed 76979 times by 66 tests: return rectangle;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitem
  • ...
76979
547}-
548-
549QT_END_NAMESPACE-
550-
551#include "moc_qquickrectangle_p.cpp"-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0