1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.widgets.dial; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.coreevent; 19 import qt.core.global; 20 import qt.core.size; 21 import qt.gui.event; 22 import qt.helpers; 23 import qt.widgets.abstractslider; 24 import qt.widgets.styleoption; 25 import qt.widgets.widget; 26 27 /+ QT_REQUIRE_CONFIG(dial); +/ 28 29 30 extern(C++, class) struct QDialPrivate; 31 /+ class QStyleOptionSlider; +/ 32 33 class /+ Q_WIDGETS_EXPORT +/ QDial: QAbstractSlider 34 { 35 mixin(Q_OBJECT); 36 37 /+ Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping) 38 Q_PROPERTY(int notchSize READ notchSize) 39 Q_PROPERTY(qreal notchTarget READ notchTarget WRITE setNotchTarget) 40 Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible) +/ 41 public: 42 /+ explicit +/this(QWidget parent = null); 43 44 ~this(); 45 46 final bool wrapping() const; 47 48 final int notchSize() const; 49 50 final void setNotchTarget(double target); 51 final qreal notchTarget() const; 52 final bool notchesVisible() const; 53 54 override QSize sizeHint() const; 55 override QSize minimumSizeHint() const; 56 57 public /+ Q_SLOTS +/: 58 @QSlot final void setNotchesVisible(bool visible); 59 @QSlot final void setWrapping(bool on); 60 61 protected: 62 override bool event(QEvent e); 63 override void resizeEvent(QResizeEvent re); 64 override void paintEvent(QPaintEvent pe); 65 66 override void mousePressEvent(QMouseEvent me); 67 override void mouseReleaseEvent(QMouseEvent me); 68 override void mouseMoveEvent(QMouseEvent me); 69 70 override void sliderChange(SliderChange change); 71 final void initStyleOption(QStyleOptionSlider* option) const; 72 73 74 private: 75 /+ Q_DECLARE_PRIVATE(QDial) +/ 76 /+ Q_DISABLE_COPY(QDial) +/ 77 } 78