QGIS API Documentation  2.17.0-Master (3a3b9ab7)
qgsslider.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsslider.h
3  -------------------
4  begin : July 2013
5  copyright : (C) 2013 by Daniel Vaz
6  email : danielvaz at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include <QSlider>
19 #include <QVariant>
20 
21 class QPaintEvent;
22 
26 class GUI_EXPORT QgsSlider : public QSlider
27 {
28  Q_OBJECT
29  public:
30  QgsSlider( QWidget *parent = nullptr );
31  QgsSlider( Qt::Orientation orientation, QWidget * parent = nullptr );
32 
33  void setMinimum( const QVariant &min );
34  void setMaximum( const QVariant &max );
35  void setSingleStep( const QVariant &step );
36  void setValue( const QVariant &value );
37  QVariant variantValue() const;
38 
39  signals:
40  void valueChanged( const QVariant& );
41 
42  protected slots:
43  void valueChanged( int );
44 
45  protected:
46  virtual void paintEvent( QPaintEvent * event ) override;
47 
48  private:
49  void update();
50 
51  QVariant mMin, mMax, mStep, mValue;
52 };
void update()
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
virtual void paintEvent(QPaintEvent *ev)
void setMinimum(int)
void setValue(int)
void setSingleStep(int)
void valueChanged(int value)
double ANALYSIS_EXPORT min(double x, double y)
Returns the minimum of two doubles or the first argument if both are equal.
void setMaximum(int)