Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qprogressbar.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
4#ifndef QPROGRESSBAR_H
5#define QPROGRESSBAR_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qframe.h>
9
10QT_REQUIRE_CONFIG(progressbar);
11
13
16
17class Q_WIDGETS_EXPORT QProgressBar : public QWidget
18{
20 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
21 Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
23 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
24 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
25 Q_PROPERTY(bool textVisible READ isTextVisible WRITE setTextVisible)
26 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
27 Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance)
28 Q_PROPERTY(Direction textDirection READ textDirection WRITE setTextDirection)
29 Q_PROPERTY(QString format READ format WRITE setFormat RESET resetFormat)
30
31public:
32 enum Direction { TopToBottom, BottomToTop };
33 Q_ENUM(Direction)
34
35 explicit QProgressBar(QWidget *parent = nullptr);
37
38 int minimum() const;
39 int maximum() const;
40
41 int value() const;
42
43 virtual QString text() const;
44 void setTextVisible(bool visible);
45 bool isTextVisible() const;
46
47 Qt::Alignment alignment() const;
48 void setAlignment(Qt::Alignment alignment);
49
50 QSize sizeHint() const override;
51 QSize minimumSizeHint() const override;
52
53 Qt::Orientation orientation() const;
54
55 void setInvertedAppearance(bool invert);
56 bool invertedAppearance() const;
57 void setTextDirection(QProgressBar::Direction textDirection);
58 QProgressBar::Direction textDirection() const;
59
60 void setFormat(const QString &format);
61 void resetFormat();
62 QString format() const;
63
64public Q_SLOTS:
65 void reset();
66 void setRange(int minimum, int maximum);
67 void setMinimum(int minimum);
68 void setMaximum(int maximum);
69 void setValue(int value);
70 void setOrientation(Qt::Orientation);
71
74
75protected:
76 bool event(QEvent *e) override;
77 void paintEvent(QPaintEvent *) override;
78 virtual void initStyleOption(QStyleOptionProgressBar *option) const;
79
80private:
81 Q_DECLARE_PRIVATE(QProgressBar)
82 Q_DISABLE_COPY(QProgressBar)
83};
84
86
87#endif // QPROGRESSBAR_H
\inmodule QtCore
Definition qcoreevent.h:45
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:485
The QProgressBar widget provides a horizontal or vertical progress bar.
Direction
Specifies the reading direction of the \l text for vertical progress bars.
void valueChanged(int value)
This signal is emitted when the value shown in the progress bar changes.
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\variable QStyleOptionButton::features
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QSize minimumSizeHint
the recommended minimum size for the widget
Definition qwidget.h:149
QSize sizeHint
the recommended size for the widget
Definition qwidget.h:148
virtual void paintEvent(QPaintEvent *event)
This event handler can be reimplemented in a subclass to receive paint events passed in event.
Definition qwidget.cpp:9829
widget setFormat(format)
QString text
double e
uint alignment
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:97
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum format
struct _cl_event * event
GLboolean reset
GLuint GLenum option
GLboolean invert
Definition qopenglext.h:226
#define QT_REQUIRE_CONFIG(feature)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
label setAlignment(Qt::AlignLeft|Qt::AlignTop)
[0]
settings setValue("DataPump/bgcolor", color)
progressBar setRange(0, 100)
setMaximum(maximum)
setMinimum(minimum)
[2]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent