QGIS API Documentation  2.99.0-Master (0a63d1f)
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 #include "qgis_gui.h"
21 
22 class QPaintEvent;
23 
27 class GUI_EXPORT QgsSlider : public QSlider
28 {
29  Q_OBJECT
30  public:
31  QgsSlider( QWidget *parent = nullptr );
32  QgsSlider( Qt::Orientation orientation, QWidget * parent = nullptr );
33 
34  void setMinimum( const QVariant &min );
35  void setMaximum( const QVariant &max );
36  void setSingleStep( const QVariant &step );
37  void setValue( const QVariant &value );
38  QVariant variantValue() const;
39 
40  signals:
41  void valueChanged( const QVariant& );
42 
43  protected slots:
44  void valueChanged( int );
45 
46  protected:
47  virtual void paintEvent( QPaintEvent * event ) override;
48 
49  private:
50  void update();
51 
52  QVariant mMin, mMax, mStep, mValue;
53 };
double ANALYSIS_EXPORT min(double x, double y)
Returns the minimum of two doubles or the first argument if both are equal.
Definition: MathUtils.cc:452
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
Definition: MathUtils.cc:437