QGIS API Documentation  2.99.0-Master (7d4f81d)
qgsdial.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdial.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 <QDial>
19 #include <QVariant>
20 #include "qgis_gui.h"
21 #include "qgis.h"
22 
23 class QPaintEvent;
24 
28 class GUI_EXPORT QgsDial : public QDial
29 {
30  Q_OBJECT
31  public:
32 
37  QgsDial( QWidget *parent SIP_TRANSFERTHIS = nullptr );
38 
39  void setMinimum( const QVariant &min );
40  void setMaximum( const QVariant &max );
41  void setSingleStep( const QVariant &step );
42  void setValue( const QVariant &value );
43  QVariant variantValue() const;
44 
45  signals:
46  void valueChanged( const QVariant & );
47 
48  private slots:
49  void onValueChanged( int );
50 
51  protected:
52  virtual void paintEvent( QPaintEvent *event ) override;
53 
54  private:
55  void update();
56 
57  QVariant mMin, mMax, mStep, mValue;
58 };
#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