Back to home page

EIC code displayed by LXR

 
 

    


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

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 #ifndef QSLIDER_H
0005 #define QSLIDER_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 
0009 #include <QtWidgets/qabstractslider.h>
0010 
0011 QT_REQUIRE_CONFIG(slider);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QSliderPrivate;
0016 class QStyleOptionSlider;
0017 class Q_WIDGETS_EXPORT QSlider : public QAbstractSlider
0018 {
0019     Q_OBJECT
0020 
0021     Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition)
0022     Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval)
0023 
0024 public:
0025     enum TickPosition {
0026         NoTicks = 0,
0027         TicksAbove = 1,
0028         TicksLeft = TicksAbove,
0029         TicksBelow = 2,
0030         TicksRight = TicksBelow,
0031         TicksBothSides = 3
0032     };
0033     Q_ENUM(TickPosition)
0034 
0035     explicit QSlider(QWidget *parent = nullptr);
0036     explicit QSlider(Qt::Orientation orientation, QWidget *parent = nullptr);
0037 
0038     ~QSlider();
0039 
0040     QSize sizeHint() const override;
0041     QSize minimumSizeHint() const override;
0042 
0043     void setTickPosition(TickPosition position);
0044     TickPosition tickPosition() const;
0045 
0046     void setTickInterval(int ti);
0047     int tickInterval() const;
0048 
0049     bool event(QEvent *event) override;
0050 
0051 protected:
0052     void paintEvent(QPaintEvent *ev) override;
0053     void mousePressEvent(QMouseEvent *ev) override;
0054     void mouseReleaseEvent(QMouseEvent *ev) override;
0055     void mouseMoveEvent(QMouseEvent *ev) override;
0056     virtual void initStyleOption(QStyleOptionSlider *option) const;
0057 
0058 
0059 private:
0060     friend Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider);
0061 
0062     Q_DISABLE_COPY(QSlider)
0063     Q_DECLARE_PRIVATE(QSlider)
0064 };
0065 
0066 QT_END_NAMESPACE
0067 
0068 #endif // QSLIDER_H