1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.widgets.progressbar; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.coreevent; 17 import qt.core.namespace; 18 import qt.core.size; 19 import qt.core.string; 20 import qt.gui.event; 21 import qt.helpers; 22 import qt.widgets.styleoption; 23 import qt.widgets.widget; 24 25 /+ QT_REQUIRE_CONFIG(progressbar); +/ 26 27 28 extern(C++, class) struct QProgressBarPrivate; 29 30 /// Binding for C++ class [QProgressBar](https://doc.qt.io/qt-6/qprogressbar.html). 31 class /+ Q_WIDGETS_EXPORT +/ QProgressBar : QWidget 32 { 33 mixin(Q_OBJECT); 34 /+ Q_PROPERTY(int minimum READ minimum WRITE setMinimum) 35 Q_PROPERTY(int maximum READ maximum WRITE setMaximum) 36 Q_PROPERTY(QString text READ text) 37 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) 38 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) 39 Q_PROPERTY(bool textVisible READ isTextVisible WRITE setTextVisible) 40 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) 41 Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance) 42 Q_PROPERTY(Direction textDirection READ textDirection WRITE setTextDirection) 43 Q_PROPERTY(QString format READ format WRITE setFormat RESET resetFormat) +/ 44 45 public: 46 enum Direction { TopToBottom, BottomToTop } 47 /+ Q_ENUM(Direction) +/ 48 49 /+ explicit +/this(QWidget parent = null); 50 ~this(); 51 52 final int minimum() const; 53 final int maximum() const; 54 55 final int value() const; 56 57 /+ virtual +/ QString text() const; 58 final void setTextVisible(bool visible); 59 final bool isTextVisible() const; 60 61 final /+ Qt:: +/qt.core.namespace.Alignment alignment() const; 62 final void setAlignment(/+ Qt:: +/qt.core.namespace.Alignment alignment); 63 64 override QSize sizeHint() const; 65 override QSize minimumSizeHint() const; 66 67 final /+ Qt:: +/qt.core.namespace.Orientation orientation() const; 68 69 final void setInvertedAppearance(bool invert); 70 final bool invertedAppearance() const; 71 final void setTextDirection(Direction textDirection); 72 final Direction textDirection() const; 73 74 final void setFormat(ref const(QString) format); 75 final void resetFormat(); 76 final QString format() const; 77 78 public /+ Q_SLOTS +/: 79 @QSlot final void reset(); 80 @QSlot final void setRange(int minimum, int maximum); 81 @QSlot final void setMinimum(int minimum); 82 @QSlot final void setMaximum(int maximum); 83 @QSlot final void setValue(int value); 84 @QSlot final void setOrientation(/+ Qt:: +/qt.core.namespace.Orientation); 85 86 /+ Q_SIGNALS +/public: 87 @QSignal final void valueChanged(int value); 88 89 protected: 90 override bool event(QEvent e); 91 override void paintEvent(QPaintEvent ); 92 /+ virtual +/ void initStyleOption(QStyleOptionProgressBar* option) const; 93 94 private: 95 /+ Q_DECLARE_PRIVATE(QProgressBar) +/ 96 /+ Q_DISABLE_COPY(QProgressBar) +/ 97 mixin(CREATE_CONVENIENCE_WRAPPERS); 98 } 99