Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:24:15

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