QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsscalerangewidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsscalerangewidget.h
3  --------------------------------------
4  Date : 25.04.2014
5  Copyright : (C) 2014 Denis Rouzaud
6  Email : [email protected]
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15 
16 #ifndef QGSSCALERANGEWIDGET_H
17 #define QGSSCALERANGEWIDGET_H
18 
19 #include <QGridLayout>
20 #include "qgis.h"
21 #include <QLabel>
22 #include "qgis_gui.h"
23 
24 class QgsMapCanvas;
25 class QgsScaleWidget;
26 
32 class GUI_EXPORT QgsScaleRangeWidget : public QWidget
33 {
34  Q_OBJECT
35  Q_PROPERTY( double minimumScale READ minimumScale WRITE setMinimumScale )
36  Q_PROPERTY( double maximumScale READ maximumScale WRITE setMaximumScale )
37 
38  public:
39 
43  explicit QgsScaleRangeWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
44 
49  void setMapCanvas( QgsMapCanvas *canvas );
50 
57  double minimumScale() const;
58 
65  double maximumScale() const;
66 
70  void reloadProjectScales();
71 
72  public slots:
73 
86  void setMinimumScale( double scale );
87 
100  void setMaximumScale( double scale );
101 
109  void setScaleRange( double min, double max );
110 
111  signals:
112 
119  void rangeChanged( double min, double max );
120 
121  private slots:
122 
123  void emitRangeChanged();
124 
125  private:
127  QgsMapCanvas *mCanvas = nullptr;
128 
129  // ui
130  QGridLayout *mLayout = nullptr;
131  QLabel *mMaximumScaleIconLabel = nullptr;
132  QLabel *mMinimumScaleIconLabel = nullptr;
133  QgsScaleWidget *mMaximumScaleWidget = nullptr;
134  QgsScaleWidget *mMinimumScaleWidget = nullptr;
135 };
136 
137 #endif // QGSSCALERANGEWIDGET_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74
A widget allowing entry of a range of map scales, e.g.