Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qabstractslider.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 QABSTRACTSLIDER_H
0005 #define QABSTRACTSLIDER_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qwidget.h>
0009 
0010 QT_REQUIRE_CONFIG(abstractslider);
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 
0015 class QAbstractSliderPrivate;
0016 
0017 class Q_WIDGETS_EXPORT QAbstractSlider : public QWidget
0018 {
0019     Q_OBJECT
0020 
0021     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
0022     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
0023     Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
0024     Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
0025     Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged USER true)
0026     Q_PROPERTY(int sliderPosition READ sliderPosition WRITE setSliderPosition NOTIFY sliderMoved)
0027     Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
0028     Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
0029     Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance)
0030     Q_PROPERTY(bool invertedControls READ invertedControls WRITE setInvertedControls)
0031     Q_PROPERTY(bool sliderDown READ isSliderDown WRITE setSliderDown DESIGNABLE false)
0032 
0033 public:
0034     explicit QAbstractSlider(QWidget *parent = nullptr);
0035     ~QAbstractSlider();
0036 
0037     Qt::Orientation orientation() const;
0038 
0039     void setMinimum(int);
0040     int minimum() const;
0041 
0042     void setMaximum(int);
0043     int maximum() const;
0044 
0045     void setSingleStep(int);
0046     int singleStep() const;
0047 
0048     void setPageStep(int);
0049     int pageStep() const;
0050 
0051     void setTracking(bool enable);
0052     bool hasTracking() const;
0053 
0054     void setSliderDown(bool);
0055     bool isSliderDown() const;
0056 
0057     void setSliderPosition(int);
0058     int sliderPosition() const;
0059 
0060     void setInvertedAppearance(bool);
0061     bool invertedAppearance() const;
0062 
0063     void setInvertedControls(bool);
0064     bool invertedControls() const;
0065 
0066     enum SliderAction {
0067         SliderNoAction,
0068         SliderSingleStepAdd,
0069         SliderSingleStepSub,
0070         SliderPageStepAdd,
0071         SliderPageStepSub,
0072         SliderToMinimum,
0073         SliderToMaximum,
0074         SliderMove
0075     };
0076 
0077     int value() const;
0078 
0079     void triggerAction(SliderAction action);
0080 
0081 public Q_SLOTS:
0082     void setValue(int);
0083     void setOrientation(Qt::Orientation);
0084     void setRange(int min, int max);
0085 
0086 Q_SIGNALS:
0087     void valueChanged(int value);
0088 
0089     void sliderPressed();
0090     void sliderMoved(int position);
0091     void sliderReleased();
0092 
0093     void rangeChanged(int min, int max);
0094 
0095     void actionTriggered(int action);
0096 
0097 protected:
0098     bool event(QEvent *e) override;
0099 
0100     void setRepeatAction(SliderAction action, int thresholdTime = 500, int repeatTime = 50);
0101     SliderAction repeatAction() const;
0102 
0103     enum SliderChange {
0104         SliderRangeChange,
0105         SliderOrientationChange,
0106         SliderStepsChange,
0107         SliderValueChange
0108     };
0109     virtual void sliderChange(SliderChange change);
0110 
0111     void keyPressEvent(QKeyEvent *ev) override;
0112     void timerEvent(QTimerEvent *) override;
0113 #if QT_CONFIG(wheelevent)
0114     void wheelEvent(QWheelEvent *e) override;
0115 #endif
0116     void changeEvent(QEvent *e) override;
0117 
0118 
0119 protected:
0120     QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent = nullptr);
0121 
0122 private:
0123     Q_DISABLE_COPY(QAbstractSlider)
0124     Q_DECLARE_PRIVATE(QAbstractSlider)
0125 };
0126 
0127 QT_END_NAMESPACE
0128 
0129 #endif // QABSTRACTSLIDER_H