Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:09:33

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 
0005 #ifndef QDIAL_H
0006 #define QDIAL_H
0007 
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 
0010 #include <QtWidgets/qabstractslider.h>
0011 
0012 QT_REQUIRE_CONFIG(dial);
0013 
0014 QT_BEGIN_NAMESPACE
0015 
0016 class QDialPrivate;
0017 class QStyleOptionSlider;
0018 
0019 class Q_WIDGETS_EXPORT QDial: public QAbstractSlider
0020 {
0021     Q_OBJECT
0022 
0023     Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping)
0024     Q_PROPERTY(int notchSize READ notchSize)
0025     Q_PROPERTY(qreal notchTarget READ notchTarget WRITE setNotchTarget)
0026     Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible)
0027 public:
0028     explicit QDial(QWidget *parent = nullptr);
0029 
0030     ~QDial();
0031 
0032     bool wrapping() const;
0033 
0034     int notchSize() const;
0035 
0036     void setNotchTarget(double target);
0037     qreal notchTarget() const;
0038     bool notchesVisible() const;
0039 
0040     QSize sizeHint() const override;
0041     QSize minimumSizeHint() const override;
0042 
0043 public Q_SLOTS:
0044     void setNotchesVisible(bool visible);
0045     void setWrapping(bool on);
0046 
0047 protected:
0048     bool event(QEvent *e) override;
0049     void resizeEvent(QResizeEvent *re) override;
0050     void paintEvent(QPaintEvent *pe) override;
0051 
0052     void mousePressEvent(QMouseEvent *me) override;
0053     void mouseReleaseEvent(QMouseEvent *me) override;
0054     void mouseMoveEvent(QMouseEvent *me) override;
0055 
0056     void sliderChange(SliderChange change) override;
0057     virtual void initStyleOption(QStyleOptionSlider *option) const;
0058 
0059 
0060 private:
0061     Q_DECLARE_PRIVATE(QDial)
0062     Q_DISABLE_COPY(QDial)
0063 };
0064 
0065 QT_END_NAMESPACE
0066 
0067 #endif // QDIAL_H