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.dial; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.coreevent; 17 import qt.core.global; 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(dial); +/ 26 27 28 extern(C++, class) struct QDialPrivate; 29 30 /// Binding for C++ class [QDial](https://doc.qt.io/qt-6/qdial.html). 31 class /+ Q_WIDGETS_EXPORT +/ QDial: QAbstractSlider 32 { 33 mixin(Q_OBJECT); 34 35 /+ Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping) 36 Q_PROPERTY(int notchSize READ notchSize) 37 Q_PROPERTY(qreal notchTarget READ notchTarget WRITE setNotchTarget) 38 Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible) +/ 39 public: 40 /+ explicit +/this(QWidget parent = null); 41 42 ~this(); 43 44 final bool wrapping() const; 45 46 final int notchSize() const; 47 48 final void setNotchTarget(double target); 49 final qreal notchTarget() const; 50 final bool notchesVisible() const; 51 52 override QSize sizeHint() const; 53 override QSize minimumSizeHint() const; 54 55 public /+ Q_SLOTS +/: 56 @QSlot final void setNotchesVisible(bool visible); 57 @QSlot final void setWrapping(bool on); 58 59 protected: 60 override bool event(QEvent e); 61 override void resizeEvent(QResizeEvent re); 62 override void paintEvent(QPaintEvent pe); 63 64 override void mousePressEvent(QMouseEvent me); 65 override void mouseReleaseEvent(QMouseEvent me); 66 override void mouseMoveEvent(QMouseEvent me); 67 68 override void sliderChange(SliderChange change); 69 /+ virtual +/ void initStyleOption(QStyleOptionSlider* option) const; 70 71 72 private: 73 /+ Q_DECLARE_PRIVATE(QDial) +/ 74 /+ Q_DISABLE_COPY(QDial) +/ 75 mixin(CREATE_CONVENIENCE_WRAPPERS); 76 } 77