11#include <private/qwidget_p.h>
12#if QT_CONFIG(accessibility)
48 : minimum(0), maximum(100),
value(-1),
alignment(
Qt::AlignLeft), textVisible(true),
49 defaultFormat(true), lastPaintedValue(-1), orientation(
Qt::Horizontal), invertedAppearance(
false),
101 option->textAlignment =
d->alignment;
102 option->textVisible =
d->textVisible;
104 option->invertedAppearance =
d->invertedAppearance;
121 if (
format.contains(
"%v"_L1))
123 if (
format.contains(
"%p"_L1) && valueDifference >=
qAbs(totalSteps / 100))
129 q->initStyleOption(&
opt);
136 return valueDifference * grooveBlock >
cw * totalSteps;
223 if (
d->minimum == INT_MIN)
226 d->value =
d->minimum - 1;
246 return d_func()->minimum;
267 return d_func()->maximum;
282 && (
d->maximum != 0 ||
d->minimum != 0)))
286#if QT_CONFIG(accessibility)
288 QAccessibleValueChangeEvent
event(
this,
value);
289 QAccessible::updateAccessibility(&
event);
292 if (
d->repaintRequired())
298 return d_func()->value;
322 if (
d->value <
qint64(
d->minimum) - 1 ||
d->value >
d->maximum)
348 return d_func()->textVisible;
365 return d_func()->alignment;
377 d_func()->lastPaintedValue = d_func()->value;
427 if ((
d->maximum == 0 &&
d->minimum == 0) ||
d->value <
d->minimum
428 || (
d->value == INT_MIN &&
d->minimum == INT_MIN))
442 if (totalSteps == 0) {
447 const auto progress =
static_cast<int>((
qint64(
d->value) -
d->minimum) * 100.0 / totalSteps);
473 d->resetLayoutItemMargins();
481 return d->orientation;
499 d->invertedAppearance =
invert;
506 return d->invertedAppearance;
529 return d->textDirection;
541 d->resetLayoutItemMargins();
544 d->initDefaultFormat();
571 d->defaultFormat =
false;
578 d->defaultFormat =
true;
579 d->initDefaultFormat();
591#include "moc_qprogressbar.cpp"
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
void setNumberOptions(NumberOptions options)
QString toString(qlonglong i) const
Returns a localized string representation of i.
NumberOptions numberOptions() const
The QPaintEvent class contains event parameters for paint events.
bool repaintRequired() const
QProgressBar::Direction textDirection
void resetLayoutItemMargins()
Qt::Orientation orientation
The QProgressBar widget provides a horizontal or vertical progress bar.
int minimum
the progress bar's minimum value
void setAlignment(Qt::Alignment alignment)
bool event(QEvent *e) override
\reimp
Direction
Specifies the reading direction of the \l text for vertical progress bars.
void reset()
Reset the progress bar.
QSize minimumSizeHint() const override
\reimp
QSize sizeHint() const override
\reimp
bool isTextVisible() const
int value
the progress bar's current value
void setTextDirection(QProgressBar::Direction textDirection)
void setInvertedAppearance(bool invert)
Qt::Orientation orientation
the orientation of the progress bar
void setTextVisible(bool visible)
void setMinimum(int minimum)
QString format
the string used to generate the current text
void setFormat(const QString &format)
void valueChanged(int value)
This signal is emitted when the value shown in the progress bar changes.
~QProgressBar()
Destructor.
Qt::Alignment alignment
the alignment of the progress bar
QString text
the descriptive text shown with the progress bar
int maximum
the progress bar's maximum value
bool invertedAppearance
whether or not a progress bar shows its progress inverted
virtual void initStyleOption(QStyleOptionProgressBar *option) const
Initialize option with the values from this QProgressBar.
void setOrientation(Qt::Orientation)
void paintEvent(QPaintEvent *) override
\reimp
Direction textDirection
the reading direction of the \l text for vertical progress bars
QProgressBar(QWidget *parent=nullptr)
Constructs a progress bar with the given parent.
void setRange(int minimum, int maximum)
Sets the progress bar's minimum and maximum values to minimum and maximum respectively.
void setMaximum(int maximum)
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\variable QStyleOptionButton::features
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ PM_ProgressBarChunkWidth
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
@ SE_ProgressBarLayoutItem
Combined button and popup list for selecting options.
@ WA_WState_OwnSizePolicy
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble GLdouble GLdouble q
static const struct TessellationWindingOrderTab cw[]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent