util/qscrollerproperties.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui 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 Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include <QPointer> -
43#include <QObject> -
44#include <QtCore/qmath.h> -
45#ifdef Q_WS_WIN -
46# include <QLibrary> -
47#endif -
48 -
49#include "qscrollerproperties.h" -
50#include "private/qscrollerproperties_p.h" -
51 -
52QT_BEGIN_NAMESPACE -
53 -
54static QScrollerPropertiesPrivate *userDefaults = 0; -
55static QScrollerPropertiesPrivate *systemDefaults = 0; -
56 -
57QScrollerPropertiesPrivate *QScrollerPropertiesPrivate::defaults() -
58{ -
59 if (!systemDefaults) {
evaluated: !systemDefaults
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:7
1-7
60 QScrollerPropertiesPrivate spp;
executed (the execution status of this line is deduced): QScrollerPropertiesPrivate spp;
-
61 spp.mousePressEventDelay = qreal(0.25);
executed (the execution status of this line is deduced): spp.mousePressEventDelay = qreal(0.25);
-
62 spp.dragStartDistance = qreal(5.0 / 1000);
executed (the execution status of this line is deduced): spp.dragStartDistance = qreal(5.0 / 1000);
-
63 spp.dragVelocitySmoothingFactor = qreal(0.8);
executed (the execution status of this line is deduced): spp.dragVelocitySmoothingFactor = qreal(0.8);
-
64 spp.axisLockThreshold = qreal(0);
executed (the execution status of this line is deduced): spp.axisLockThreshold = qreal(0);
-
65 spp.scrollingCurve.setType(QEasingCurve::OutQuad);
executed (the execution status of this line is deduced): spp.scrollingCurve.setType(QEasingCurve::OutQuad);
-
66 spp.decelerationFactor = qreal(0.125);
executed (the execution status of this line is deduced): spp.decelerationFactor = qreal(0.125);
-
67 spp.minimumVelocity = qreal(50.0 / 1000);
executed (the execution status of this line is deduced): spp.minimumVelocity = qreal(50.0 / 1000);
-
68 spp.maximumVelocity = qreal(500.0 / 1000);
executed (the execution status of this line is deduced): spp.maximumVelocity = qreal(500.0 / 1000);
-
69 spp.maximumClickThroughVelocity = qreal(66.5 / 1000);
executed (the execution status of this line is deduced): spp.maximumClickThroughVelocity = qreal(66.5 / 1000);
-
70 spp.acceleratingFlickMaximumTime = qreal(1.25);
executed (the execution status of this line is deduced): spp.acceleratingFlickMaximumTime = qreal(1.25);
-
71 spp.acceleratingFlickSpeedupFactor = qreal(3.0);
executed (the execution status of this line is deduced): spp.acceleratingFlickSpeedupFactor = qreal(3.0);
-
72 spp.snapPositionRatio = qreal(0.5);
executed (the execution status of this line is deduced): spp.snapPositionRatio = qreal(0.5);
-
73 spp.snapTime = qreal(0.3);
executed (the execution status of this line is deduced): spp.snapTime = qreal(0.3);
-
74 spp.overshootDragResistanceFactor = qreal(0.5);
executed (the execution status of this line is deduced): spp.overshootDragResistanceFactor = qreal(0.5);
-
75 spp.overshootDragDistanceFactor = qreal(1);
executed (the execution status of this line is deduced): spp.overshootDragDistanceFactor = qreal(1);
-
76 spp.overshootScrollDistanceFactor = qreal(0.5);
executed (the execution status of this line is deduced): spp.overshootScrollDistanceFactor = qreal(0.5);
-
77 spp.overshootScrollTime = qreal(0.7);
executed (the execution status of this line is deduced): spp.overshootScrollTime = qreal(0.7);
-
78# ifdef Q_WS_WIN -
79 if (QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback")) -
80 spp.overshootScrollTime = qreal(0.35); -
81# endif -
82 spp.hOvershootPolicy = QScrollerProperties::OvershootWhenScrollable;
executed (the execution status of this line is deduced): spp.hOvershootPolicy = QScrollerProperties::OvershootWhenScrollable;
-
83 spp.vOvershootPolicy = QScrollerProperties::OvershootWhenScrollable;
executed (the execution status of this line is deduced): spp.vOvershootPolicy = QScrollerProperties::OvershootWhenScrollable;
-
84 spp.frameRate = QScrollerProperties::Standard;
executed (the execution status of this line is deduced): spp.frameRate = QScrollerProperties::Standard;
-
85 -
86 systemDefaults = new QScrollerPropertiesPrivate(spp);
executed (the execution status of this line is deduced): systemDefaults = new QScrollerPropertiesPrivate(spp);
-
87 }
executed: }
Execution Count:1
1
88 return new QScrollerPropertiesPrivate(userDefaults ? *userDefaults : *systemDefaults);
executed: return new QScrollerPropertiesPrivate(userDefaults ? *userDefaults : *systemDefaults);
Execution Count:8
8
89} -
90 -
91/*! -
92 \class QScrollerProperties -
93 \brief The QScrollerProperties class stores the settings for a QScroller. -
94 \since 4.8 -
95 -
96 \inmodule QtWidgets -
97 -
98 The QScrollerProperties class stores the parameters used by QScroller. -
99 -
100 The default settings are platform dependent so that Qt emulates the -
101 platform behaviour for kinetic scrolling. -
102 -
103 As a convention the QScrollerProperties are in physical units (meter, -
104 seconds) and are converted by QScroller using the current DPI. -
105 -
106 \sa QScroller -
107*/ -
108 -
109/*! -
110 Constructs new scroller properties. -
111*/ -
112QScrollerProperties::QScrollerProperties() -
113 : d(QScrollerPropertiesPrivate::defaults()) -
114{ -
115}
executed: }
Execution Count:8
8
116 -
117/*! -
118 Constructs a copy of \a sp. -
119*/ -
120QScrollerProperties::QScrollerProperties(const QScrollerProperties &sp) -
121 : d(new QScrollerPropertiesPrivate(*sp.d)) -
122{ -
123}
executed: }
Execution Count:12
12
124 -
125/*! -
126 Assigns \a sp to these scroller properties and returns a reference to these scroller properties. -
127*/ -
128QScrollerProperties &QScrollerProperties::operator=(const QScrollerProperties &sp) -
129{ -
130 *d.data() = *sp.d.data();
executed (the execution status of this line is deduced): *d.data() = *sp.d.data();
-
131 return *this;
executed: return *this;
Execution Count:4
4
132} -
133 -
134/*! -
135 Destroys the scroller properties. -
136*/ -
137QScrollerProperties::~QScrollerProperties() -
138{ -
139} -
140 -
141/*! -
142 Returns true if these scroller properties are equal to \a sp; otherwise returns false. -
143*/ -
144bool QScrollerProperties::operator==(const QScrollerProperties &sp) const -
145{ -
146 return *d.data() == *sp.d.data();
executed: return *d.data() == *sp.d.data();
Execution Count:2
2
147} -
148 -
149/*! -
150 Returns true if these scroller properties are different from \a sp; otherwise returns false. -
151*/ -
152bool QScrollerProperties::operator!=(const QScrollerProperties &sp) const -
153{ -
154 return !(*d.data() == *sp.d.data());
executed: return !(*d.data() == *sp.d.data());
Execution Count:5
5
155} -
156 -
157bool QScrollerPropertiesPrivate::operator==(const QScrollerPropertiesPrivate &p) const -
158{ -
159 bool same = true;
executed (the execution status of this line is deduced): bool same = true;
-
160 same &= (mousePressEventDelay == p.mousePressEventDelay);
executed (the execution status of this line is deduced): same &= (mousePressEventDelay == p.mousePressEventDelay);
-
161 same &= (dragStartDistance == p.dragStartDistance);
executed (the execution status of this line is deduced): same &= (dragStartDistance == p.dragStartDistance);
-
162 same &= (dragVelocitySmoothingFactor == p.dragVelocitySmoothingFactor);
executed (the execution status of this line is deduced): same &= (dragVelocitySmoothingFactor == p.dragVelocitySmoothingFactor);
-
163 same &= (axisLockThreshold == p.axisLockThreshold);
executed (the execution status of this line is deduced): same &= (axisLockThreshold == p.axisLockThreshold);
-
164 same &= (scrollingCurve == p.scrollingCurve);
executed (the execution status of this line is deduced): same &= (scrollingCurve == p.scrollingCurve);
-
165 same &= (decelerationFactor == p.decelerationFactor);
executed (the execution status of this line is deduced): same &= (decelerationFactor == p.decelerationFactor);
-
166 same &= (minimumVelocity == p.minimumVelocity);
executed (the execution status of this line is deduced): same &= (minimumVelocity == p.minimumVelocity);
-
167 same &= (maximumVelocity == p.maximumVelocity);
executed (the execution status of this line is deduced): same &= (maximumVelocity == p.maximumVelocity);
-
168 same &= (maximumClickThroughVelocity == p.maximumClickThroughVelocity);
executed (the execution status of this line is deduced): same &= (maximumClickThroughVelocity == p.maximumClickThroughVelocity);
-
169 same &= (acceleratingFlickMaximumTime == p.acceleratingFlickMaximumTime);
executed (the execution status of this line is deduced): same &= (acceleratingFlickMaximumTime == p.acceleratingFlickMaximumTime);
-
170 same &= (acceleratingFlickSpeedupFactor == p.acceleratingFlickSpeedupFactor);
executed (the execution status of this line is deduced): same &= (acceleratingFlickSpeedupFactor == p.acceleratingFlickSpeedupFactor);
-
171 same &= (snapPositionRatio == p.snapPositionRatio);
executed (the execution status of this line is deduced): same &= (snapPositionRatio == p.snapPositionRatio);
-
172 same &= (snapTime == p.snapTime);
executed (the execution status of this line is deduced): same &= (snapTime == p.snapTime);
-
173 same &= (overshootDragResistanceFactor == p.overshootDragResistanceFactor);
executed (the execution status of this line is deduced): same &= (overshootDragResistanceFactor == p.overshootDragResistanceFactor);
-
174 same &= (overshootDragDistanceFactor == p.overshootDragDistanceFactor);
executed (the execution status of this line is deduced): same &= (overshootDragDistanceFactor == p.overshootDragDistanceFactor);
-
175 same &= (overshootScrollDistanceFactor == p.overshootScrollDistanceFactor);
executed (the execution status of this line is deduced): same &= (overshootScrollDistanceFactor == p.overshootScrollDistanceFactor);
-
176 same &= (overshootScrollTime == p.overshootScrollTime);
executed (the execution status of this line is deduced): same &= (overshootScrollTime == p.overshootScrollTime);
-
177 same &= (hOvershootPolicy == p.hOvershootPolicy);
executed (the execution status of this line is deduced): same &= (hOvershootPolicy == p.hOvershootPolicy);
-
178 same &= (vOvershootPolicy == p.vOvershootPolicy);
executed (the execution status of this line is deduced): same &= (vOvershootPolicy == p.vOvershootPolicy);
-
179 same &= (frameRate == p.frameRate);
executed (the execution status of this line is deduced): same &= (frameRate == p.frameRate);
-
180 return same;
executed: return same;
Execution Count:7
7
181} -
182 -
183/*! -
184 Sets the scroller properties for all new QScrollerProperties objects to \a sp. -
185 -
186 Use this function to override the platform default properties returned by the default -
187 constructor. If you only want to change the scroller properties of a single scroller, use -
188 QScroller::setScrollerProperties() -
189 -
190 \note Calling this function will not change the content of already existing -
191 QScrollerProperties objects. -
192 -
193 \sa unsetDefaultScrollerProperties() -
194*/ -
195void QScrollerProperties::setDefaultScrollerProperties(const QScrollerProperties &sp) -
196{ -
197 if (!userDefaults)
never evaluated: !userDefaults
0
198 userDefaults = new QScrollerPropertiesPrivate(*sp.d);
never executed: userDefaults = new QScrollerPropertiesPrivate(*sp.d);
0
199 else -
200 *userDefaults = *sp.d;
never executed: *userDefaults = *sp.d;
0
201} -
202 -
203/*! -
204 Sets the scroller properties returned by the default constructor back to the platform default -
205 properties. -
206 -
207 \sa setDefaultScrollerProperties() -
208*/ -
209void QScrollerProperties::unsetDefaultScrollerProperties() -
210{ -
211 delete userDefaults;
never executed (the execution status of this line is deduced): delete userDefaults;
-
212 userDefaults = 0;
never executed (the execution status of this line is deduced): userDefaults = 0;
-
213}
never executed: }
0
214 -
215/*! -
216 Query the \a metric value of the scroller properties. -
217 -
218 \sa setScrollMetric(), ScrollMetric -
219*/ -
220QVariant QScrollerProperties::scrollMetric(ScrollMetric metric) const -
221{ -
222 switch (metric) { -
223 case MousePressEventDelay: return d->mousePressEventDelay;
executed: return d->mousePressEventDelay;
Execution Count:1
1
224 case DragStartDistance: return d->dragStartDistance;
executed: return d->dragStartDistance;
Execution Count:1
1
225 case DragVelocitySmoothingFactor: return d->dragVelocitySmoothingFactor;
executed: return d->dragVelocitySmoothingFactor;
Execution Count:1
1
226 case AxisLockThreshold: return d->axisLockThreshold;
executed: return d->axisLockThreshold;
Execution Count:1
1
227 case ScrollingCurve: return d->scrollingCurve;
executed: return d->scrollingCurve;
Execution Count:1
1
228 case DecelerationFactor: return d->decelerationFactor;
executed: return d->decelerationFactor;
Execution Count:1
1
229 case MinimumVelocity: return d->minimumVelocity;
executed: return d->minimumVelocity;
Execution Count:1
1
230 case MaximumVelocity: return d->maximumVelocity;
executed: return d->maximumVelocity;
Execution Count:1
1
231 case MaximumClickThroughVelocity: return d->maximumClickThroughVelocity;
executed: return d->maximumClickThroughVelocity;
Execution Count:1
1
232 case AcceleratingFlickMaximumTime: return d->acceleratingFlickMaximumTime;
executed: return d->acceleratingFlickMaximumTime;
Execution Count:1
1
233 case AcceleratingFlickSpeedupFactor:return d->acceleratingFlickSpeedupFactor;
executed: return d->acceleratingFlickSpeedupFactor;
Execution Count:1
1
234 case SnapPositionRatio: return d->snapPositionRatio;
executed: return d->snapPositionRatio;
Execution Count:1
1
235 case SnapTime: return d->snapTime;
executed: return d->snapTime;
Execution Count:1
1
236 case OvershootDragResistanceFactor: return d->overshootDragResistanceFactor;
executed: return d->overshootDragResistanceFactor;
Execution Count:1
1
237 case OvershootDragDistanceFactor: return d->overshootDragDistanceFactor;
executed: return d->overshootDragDistanceFactor;
Execution Count:1
1
238 case OvershootScrollDistanceFactor: return d->overshootScrollDistanceFactor;
executed: return d->overshootScrollDistanceFactor;
Execution Count:1
1
239 case OvershootScrollTime: return d->overshootScrollTime;
executed: return d->overshootScrollTime;
Execution Count:1
1
240 case HorizontalOvershootPolicy: return QVariant::fromValue(d->hOvershootPolicy);
executed: return QVariant::fromValue(d->hOvershootPolicy);
Execution Count:1
1
241 case VerticalOvershootPolicy: return QVariant::fromValue(d->vOvershootPolicy);
executed: return QVariant::fromValue(d->vOvershootPolicy);
Execution Count:1
1
242 case FrameRate: return QVariant::fromValue(d->frameRate);
executed: return QVariant::fromValue(d->frameRate);
Execution Count:1
1
243 case ScrollMetricCount: break;
never executed: break;
0
244 } -
245 return QVariant();
never executed: return QVariant();
0
246} -
247 -
248/*! -
249 Set a specific value of the \a metric ScrollerMetric to \a value. -
250 -
251 \sa scrollMetric(), ScrollMetric -
252*/ -
253void QScrollerProperties::setScrollMetric(ScrollMetric metric, const QVariant &value) -
254{ -
255 switch (metric) { -
256 case MousePressEventDelay: d->mousePressEventDelay = value.toReal(); break;
executed: break;
Execution Count:1
1
257 case DragStartDistance: d->dragStartDistance = value.toReal(); break;
executed: break;
Execution Count:1
1
258 case DragVelocitySmoothingFactor: d->dragVelocitySmoothingFactor = qBound(qreal(0), value.toReal(), qreal(1)); break;
executed: break;
Execution Count:1
1
259 case AxisLockThreshold: d->axisLockThreshold = qBound(qreal(0), value.toReal(), qreal(1)); break;
executed: break;
Execution Count:1
1
260 case ScrollingCurve: d->scrollingCurve = value.toEasingCurve(); break;
executed: break;
Execution Count:1
1
261 case DecelerationFactor: d->decelerationFactor = value.toReal(); break;
executed: break;
Execution Count:1
1
262 case MinimumVelocity: d->minimumVelocity = value.toReal(); break;
executed: break;
Execution Count:1
1
263 case MaximumVelocity: d->maximumVelocity = value.toReal(); break;
executed: break;
Execution Count:1
1
264 case MaximumClickThroughVelocity: d->maximumClickThroughVelocity = value.toReal(); break;
executed: break;
Execution Count:1
1
265 case AcceleratingFlickMaximumTime: d->acceleratingFlickMaximumTime = value.toReal(); break;
executed: break;
Execution Count:1
1
266 case AcceleratingFlickSpeedupFactor:d->acceleratingFlickSpeedupFactor = value.toReal(); break;
executed: break;
Execution Count:1
1
267 case SnapPositionRatio: d->snapPositionRatio = qBound(qreal(0), value.toReal(), qreal(1)); break;
executed: break;
Execution Count:1
1
268 case SnapTime: d->snapTime = value.toReal(); break;
executed: break;
Execution Count:1
1
269 case OvershootDragResistanceFactor: d->overshootDragResistanceFactor = value.toReal(); break;
executed: break;
Execution Count:2
2
270 case OvershootDragDistanceFactor: d->overshootDragDistanceFactor = qBound(qreal(0), value.toReal(), qreal(1)); break;
executed: break;
Execution Count:3
3
271 case OvershootScrollDistanceFactor: d->overshootScrollDistanceFactor = qBound(qreal(0), value.toReal(), qreal(1)); break;
executed: break;
Execution Count:3
3
272 case OvershootScrollTime: d->overshootScrollTime = value.toReal(); break;
executed: break;
Execution Count:1
1
273 case HorizontalOvershootPolicy: d->hOvershootPolicy = value.value<QScrollerProperties::OvershootPolicy>(); break;
executed: break;
Execution Count:6
6
274 case VerticalOvershootPolicy: d->vOvershootPolicy = value.value<QScrollerProperties::OvershootPolicy>(); break;
executed: break;
Execution Count:1
1
275 case FrameRate: d->frameRate = value.value<QScrollerProperties::FrameRates>(); break;
executed: break;
Execution Count:1
1
276 case ScrollMetricCount: break;
never executed: break;
0
277 } -
278}
executed: }
Execution Count:30
30
279 -
280/*! -
281 \enum QScrollerProperties::FrameRates -
282 -
283 This enum describes the available frame rates used while dragging or scrolling. -
284 -
285 \value Fps60 60 frames per second -
286 \value Fps30 30 frames per second -
287 \value Fps20 20 frames per second -
288 \value Standard the default value is 60 frames per second (which corresponds to QAbstractAnimation). -
289*/ -
290 -
291/*! -
292 \enum QScrollerProperties::OvershootPolicy -
293 -
294 This enum describes the various modes of overshooting. -
295 -
296 \value OvershootWhenScrollable Overshooting is possible when the content is scrollable. This is the -
297 default. -
298 -
299 \value OvershootAlwaysOff Overshooting is never enabled, even when the content is scrollable. -
300 -
301 \value OvershootAlwaysOn Overshooting is always enabled, even when the content is not -
302 scrollable. -
303*/ -
304 -
305/*! -
306 \enum QScrollerProperties::ScrollMetric -
307 -
308 This enum contains the different scroll metric types. When not indicated otherwise the -
309 setScrollMetric function expects a QVariant of type qreal. -
310 -
311 See the QScroller documentation for further details of the concepts behind the different -
312 values. -
313 -
314 \value MousePressEventDelay This is the time a mouse press event is delayed when starting -
315 a flick gesture in \c{[s]}. If the gesture is triggered within that time, no mouse press or -
316 release is sent to the scrolled object. If it triggers after that delay the delayed -
317 mouse press plus a faked release event at global position \c{QPoint(-QWIDGETSIZE_MAX, -
318 -QWIDGETSIZE_MAX)} is sent. If the gesture is canceled, then both the delayed mouse -
319 press plus the real release event are delivered. -
320 -
321 \value DragStartDistance This is the minimum distance the touch or mouse point needs to be -
322 moved before the flick gesture is triggered in \c m. -
323 -
324 \value DragVelocitySmoothingFactor A value that describes to which extent new drag velocities are -
325 included in the final scrolling velocity. This value should be in the range between \c 0 and -
326 \c 1. The lower the value, the more smoothing is applied to the dragging velocity. -
327 -
328 \value AxisLockThreshold Restricts the movement to one axis if the movement is inside an angle -
329 around the axis. The threshold must be in the range \c 0 to \c 1. -
330 -
331 \value ScrollingCurve The QEasingCurve used when decelerating the scrolling velocity after an -
332 user initiated flick. Please note that this is the easing curve for the positions, \b{not} -
333 the velocity: the default is QEasingCurve::OutQuad, which results in a linear decrease in -
334 velocity (1st derivative) and a constant deceleration (2nd derivative). -
335 -
336 \value DecelerationFactor This factor influences how long it takes the scroller to decelerate -
337 to 0 velocity. The actual value depends on the chosen ScrollingCurve. For most -
338 types the value should be in the range from \c 0.1 to \c 2.0 -
339 -
340 \value MinimumVelocity The minimum velocity that is needed after ending the touch or releasing -
341 the mouse to start scrolling in \c{m/s}. -
342 -
343 \value MaximumVelocity This is the maximum velocity that can be reached in \c{m/s}. -
344 -
345 \value MaximumClickThroughVelocity This is the maximum allowed scroll speed for a click-through -
346 in \c{m/s}. This means that a click on a currently (slowly) scrolling object will not only stop -
347 the scrolling but the click event will also be delivered to the UI control. This is -
348 useful when using exponential-type scrolling curves. -
349 -
350 \value AcceleratingFlickMaximumTime This is the maximum time in \c seconds that a flick gesture -
351 can take to be recognized as an accelerating flick. If set to zero no such gesture is -
352 detected. An "accelerating flick" is a flick gesture executed on an already scrolling object. -
353 In such cases the scrolling speed is multiplied by AcceleratingFlickSpeedupFactor in order to -
354 accelerate it. -
355 -
356 \value AcceleratingFlickSpeedupFactor The current speed is multiplied by this number if an -
357 accelerating flick is detected. Should be \c{>= 1}. -
358 -
359 \value SnapPositionRatio This is the distance that the user must drag the area beween two snap -
360 points in order to snap it to the next position. \c{0.33} means that the scroll must only -
361 reach one third of the distance between two snap points to snap to the next one. The ratio must -
362 be between \c 0 and \c 1. -
363 -
364 \value SnapTime This is the time factor for the scrolling curve. A lower value means that the -
365 scrolling will take longer. The scrolling distance is independet of this value. -
366 -
367 \value OvershootDragResistanceFactor This value is the factor between the mouse dragging and -
368 the actual scroll area movement (during overshoot). The factor must be between \c 0 and \c 1. -
369 -
370 \value OvershootDragDistanceFactor This is the maximum distance for overshoot movements while -
371 dragging. The actual overshoot distance is calculated by multiplying this value with the -
372 viewport size of the scrolled object. The factor must be between \c 0 and \c 1. -
373 -
374 \value OvershootScrollDistanceFactor This is the maximum distance for overshoot movements while -
375 scrolling. The actual overshoot distance is calculated by multiplying this value with the -
376 viewport size of the scrolled object. The factor must be between \c 0 and \c 1. -
377 -
378 \value OvershootScrollTime This is the time in \c seconds that is used to play the -
379 complete overshoot animation. -
380 -
381 \value HorizontalOvershootPolicy This is the horizontal overshooting policy (see OvershootPolicy). -
382 -
383 \value VerticalOvershootPolicy This is the horizontal overshooting policy (see OvershootPolicy). -
384 -
385 \value FrameRate This is the frame rate which should be used while dragging or scrolling. -
386 QScroller uses a QAbstractAnimation timer internally to sync all scrolling operations to other -
387 animations that might be active at the same time. If the standard value of 60 frames per -
388 second is too fast, it can be lowered with this setting, -
389 while still being in-sync with QAbstractAnimation. Please note that only the values of the -
390 FrameRates enum are allowed here. -
391 -
392 \value ScrollMetricCount This is always the last entry. -
393*/ -
394 -
395QT_END_NAMESPACE -
396 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial