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.slider; 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.gui.event; 20 import qt.helpers; 21 import qt.widgets.abstractslider; 22 import qt.widgets.styleoption; 23 import qt.widgets.widget; 24 25 /+ QT_REQUIRE_CONFIG(slider); +/ 26 27 28 extern(C++, class) struct QSliderPrivate; 29 /// Binding for C++ class [QSlider](https://doc.qt.io/qt-6/qslider.html). 30 class /+ Q_WIDGETS_EXPORT +/ QSlider : QAbstractSlider 31 { 32 mixin(Q_OBJECT); 33 34 /+ Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition) 35 Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval) +/ 36 37 public: 38 enum TickPosition { 39 NoTicks = 0, 40 TicksAbove = 1, 41 TicksLeft = TickPosition.TicksAbove, 42 TicksBelow = 2, 43 TicksRight = TickPosition.TicksBelow, 44 TicksBothSides = 3 45 } 46 /+ Q_ENUM(TickPosition) +/ 47 48 /+ explicit +/this(QWidget parent = null); 49 /+ explicit +/this(/+ Qt:: +/qt.core.namespace.Orientation orientation, QWidget parent = null); 50 51 ~this(); 52 53 override QSize sizeHint() const; 54 override QSize minimumSizeHint() const; 55 56 final void setTickPosition(TickPosition position); 57 final TickPosition tickPosition() const; 58 59 final void setTickInterval(int ti); 60 final int tickInterval() const; 61 62 override bool event(QEvent event); 63 64 protected: 65 override void paintEvent(QPaintEvent ev); 66 override void mousePressEvent(QMouseEvent ev); 67 override void mouseReleaseEvent(QMouseEvent ev); 68 override void mouseMoveEvent(QMouseEvent ev); 69 /+ virtual +/ void initStyleOption(QStyleOptionSlider* option) const; 70 71 72 private: 73 /+ friend Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider); +/ 74 75 /+ Q_DISABLE_COPY(QSlider) +/ 76 /+ Q_DECLARE_PRIVATE(QSlider) +/ 77 mixin(CREATE_CONVENIENCE_WRAPPERS); 78 } 79