OpenCoverage

qquicktargetdirection_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/particles/qquicktargetdirection_p.h
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#ifndef DIRECTEDVECTOR_H-
41#define DIRECTEDVECTOR_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#include "qquickdirection_p.h"-
54QT_BEGIN_NAMESPACE-
55-
56class QQuickItem;-
57class QQuickTargetDirection : public QQuickDirection-
58{-
59 Q_OBJECT-
60 Q_PROPERTY(qreal targetX READ targetX WRITE setTargetX NOTIFY targetXChanged)-
61 Q_PROPERTY(qreal targetY READ targetY WRITE setTargetY NOTIFY targetYChanged)-
62 //If targetItem is set, X/Y are ignored. Aims at middle of item, use variation for variation-
63 Q_PROPERTY(QQuickItem* targetItem READ targetItem WRITE setTargetItem NOTIFY targetItemChanged)-
64-
65 Q_PROPERTY(qreal targetVariation READ targetVariation WRITE setTargetVariation NOTIFY targetVariationChanged)-
66-
67 //TODO: An enum would be better-
68 Q_PROPERTY(bool proportionalMagnitude READ proportionalMagnitude WRITE setProportionalMagnitude NOTIFY proprotionalMagnitudeChanged)-
69 Q_PROPERTY(qreal magnitude READ magnitude WRITE setMagnitude NOTIFY magnitudeChanged)-
70 Q_PROPERTY(qreal magnitudeVariation READ magnitudeVariation WRITE setMagnitudeVariation NOTIFY magnitudeVariationChanged)-
71-
72public:-
73 explicit QQuickTargetDirection(QObject *parent = 0);-
74 QPointF sample(const QPointF &from) override;-
75-
76 qreal targetX() const-
77 {-
78 return m_targetX;
never executed: return m_targetX;
0
79 }-
80-
81 qreal targetY() const-
82 {-
83 return m_targetY;
never executed: return m_targetY;
0
84 }-
85-
86 qreal targetVariation() const-
87 {-
88 return m_targetVariation;
never executed: return m_targetVariation;
0
89 }-
90-
91 qreal magnitude() const-
92 {-
93 return m_magnitude;
never executed: return m_magnitude;
0
94 }-
95-
96 bool proportionalMagnitude() const-
97 {-
98 return m_proportionalMagnitude;
never executed: return m_proportionalMagnitude;
0
99 }-
100-
101 qreal magnitudeVariation() const-
102 {-
103 return m_magnitudeVariation;
never executed: return m_magnitudeVariation;
0
104 }-
105-
106 QQuickItem* targetItem() const-
107 {-
108 return m_targetItem;
never executed: return m_targetItem;
0
109 }-
110-
111Q_SIGNALS:-
112-
113 void targetXChanged(qreal arg);-
114-
115 void targetYChanged(qreal arg);-
116-
117 void targetVariationChanged(qreal arg);-
118-
119 void magnitudeChanged(qreal arg);-
120-
121 void proprotionalMagnitudeChanged(bool arg);-
122-
123 void magnitudeVariationChanged(qreal arg);-
124-
125 void targetItemChanged(QQuickItem* arg);-
126-
127public Q_SLOTS:-
128 void setTargetX(qreal arg)-
129 {-
130 if (m_targetX != arg) {
m_targetX != argDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-14
131 m_targetX = arg;-
132 Q_EMIT targetXChanged(arg);-
133 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_examples
14
134 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_examples
14
135-
136 void setTargetY(qreal arg)-
137 {-
138 if (m_targetY != arg) {
m_targetY != argDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-14
139 m_targetY = arg;-
140 Q_EMIT targetYChanged(arg);-
141 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_examples
14
142 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_examples
14
143-
144 void setTargetVariation(qreal arg)-
145 {-
146 if (m_targetVariation != arg) {
m_targetVariation != argDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-2
147 m_targetVariation = arg;-
148 Q_EMIT targetVariationChanged(arg);-
149 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
150 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
151-
152 void setMagnitude(qreal arg)-
153 {-
154 if (m_magnitude != arg) {
m_magnitude != argDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktargetdirection
FALSEnever evaluated
0-16
155 m_magnitude = arg;-
156 Q_EMIT magnitudeChanged(arg);-
157 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktargetdirection
16
158 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktargetdirection
16
159-
160 void setProportionalMagnitude(bool arg)-
161 {-
162 if (m_proportionalMagnitude != arg) {
m_proportionalMagnitude != argDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktargetdirection
FALSEnever evaluated
0-8
163 m_proportionalMagnitude = arg;-
164 Q_EMIT proprotionalMagnitudeChanged(arg);-
165 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktargetdirection
8
166 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktargetdirection
8
167-
168 void setMagnitudeVariation(qreal arg)-
169 {-
170 if (m_magnitudeVariation != arg) {
m_magnitudeVariation != argDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-8
171 m_magnitudeVariation = arg;-
172 Q_EMIT magnitudeVariationChanged(arg);-
173 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
174 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
175-
176 void setTargetItem(QQuickItem* arg)-
177 {-
178 if (m_targetItem != arg) {
m_targetItem != argDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktargetdirection
FALSEnever evaluated
0-2
179 m_targetItem = arg;-
180 Q_EMIT targetItemChanged(arg);-
181 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktargetdirection
2
182 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquicktargetdirection
2
183-
184private:-
185 qreal m_targetX;-
186 qreal m_targetY;-
187 qreal m_targetVariation;-
188 bool m_proportionalMagnitude;-
189 qreal m_magnitude;-
190 qreal m_magnitudeVariation;-
191 QQuickItem *m_targetItem;-
192};-
193-
194QT_END_NAMESPACE-
195#endif // DIRECTEDVECTOR_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0