QGIS API Documentation  2.99.0-Master (dcec6bb)
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 "qgis.h"
20 #include <QVariant>
21 #include "qgis_gui.h"
22 
23 class QPaintEvent;
24 
28 class GUI_EXPORT QgsSlider : public QSlider
29 {
30  Q_OBJECT
31  public:
32  QgsSlider( QWidget *parent SIP_TRANSFERTHIS = 0 );
33  QgsSlider( Qt::Orientation orientation, QWidget *parent SIP_TRANSFERTHIS = 0 );
34 
35  void setMinimum( const QVariant &min );
36  void setMaximum( const QVariant &max );
37  void setSingleStep( const QVariant &step );
38  void setValue( const QVariant &value );
39  QVariant variantValue() const;
40 
41  signals:
42  void valueChanged( const QVariant & );
43 
44  private slots:
45  void onValueChanged( int );
46 
47  protected:
48  virtual void paintEvent( QPaintEvent *event ) override;
49 
50  private:
51  void update();
52 
53  QVariant mMin, mMax, mStep, mValue;
54 };
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
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