Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickprogressbar.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5#include "qquickcontrol_p_p.h"
6
8
13
57{
58public:
60 qreal to = 1;
62 bool indeterminate = false;
63};
64
67{
68}
69
78{
79 Q_D(const QQuickProgressBar);
80 return d->from;
81}
82
84{
86 if (qFuzzyCompare(d->from, from))
87 return;
88
89 d->from = from;
94 setValue(d->value);
95}
96
105{
106 Q_D(const QQuickProgressBar);
107 return d->to;
108}
109
111{
113 if (qFuzzyCompare(d->to, to))
114 return;
115
116 d->to = to;
117 emit toChanged();
121 setValue(d->value);
122}
123
132{
133 Q_D(const QQuickProgressBar);
134 return d->value;
135}
136
138{
141 value = d->from > d->to ? qBound(d->to, value, d->from) : qBound(d->from, value, d->to);
142
143 if (qFuzzyCompare(d->value, value))
144 return;
145
146 d->value = value;
150}
151
165{
166 Q_D(const QQuickProgressBar);
167 if (qFuzzyCompare(d->from, d->to))
168 return 0;
169 return (d->value - d->from) / (d->to - d->from);
170}
171
186{
187 if (isMirrored())
188 return 1.0 - position();
189 return position();
190}
191
202{
203 Q_D(const QQuickProgressBar);
204 return d->indeterminate;
205}
206
208{
210 if (d->indeterminate == indeterminate)
211 return;
212
213 d->indeterminate = indeterminate;
215}
216
218{
220 if (!qFuzzyCompare(position(), qreal(0.5)))
222}
223
225{
228 setValue(d->value);
229}
230
231#if QT_CONFIG(accessibility)
232QAccessible::Role QQuickProgressBar::accessibleRole() const
233{
234 return QAccessible::ProgressBar;
235}
236#endif
237
239
240#include "moc_qquickprogressbar_p.cpp"
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
bool isMirrored() const
\qmlproperty bool QtQuick.Controls::Control::mirrored \readonly
virtual void mirrorChange()
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
Indicates the progress of an operation.
void indeterminateChanged()
void visualPositionChanged()
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void mirrorChange() override
void setIndeterminate(bool indeterminate)
QQuickProgressBar(QQuickItem *parent=nullptr)
void setValue(qreal value)
void setFrom(qreal from)
bool isIndeterminate() const
\qmlproperty bool QtQuick.Controls::ProgressBar::indeterminate
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
constexpr const T & qBound(const T &min, const T &val, const T &max)
Definition qminmax.h:44
#define emit
double qreal
Definition qtypes.h:92
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent