QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 <QLabel>
21 
22 #include "qgscollapsiblegroupbox.h"
23 #include "qgsmaplayer.h"
24 #include "qgsmapcanvas.h"
25 #include "qgsscalewidget.h"
26 
30 class GUI_EXPORT QgsScaleRangeWidget : public QWidget
31 {
32  Q_OBJECT
33 
34  public:
35  explicit QgsScaleRangeWidget( QWidget *parent = nullptr );
37 
39 
43  void setMapCanvas( QgsMapCanvas* mapCanvas );
44 
46  double minimumScale();
47 
49  double maximumScale();
50 
55  double minimumScaleDenom();
56 
61  double maximumScaleDenom();
62 
64  void reloadProjectScales();
65 
66  public slots:
70  void setMinimumScale( double scale );
71 
75  void setMaximumScale( double scale );
76 
77  void setScaleRange( double min, double max );
78 
79  signals:
80 
86  void rangeChanged( double min, double max );
87 
88  private slots:
89 
90  void emitRangeChanged();
91 
92  private:
94  QgsMapCanvas* mCanvas;
95 
96  // ui
97  QGridLayout* mLayout;
98  QLabel* mMaximumScaleIconLabel;
99  QLabel* mMinimumScaleIconLabel;
100  QgsScaleWidget* mMaximumScaleWidget;
101  QgsScaleWidget* mMinimumScaleWidget;
102 };
103 
104 #endif // QGSSCALERANGEWIDGET_H
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:109
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
double ANALYSIS_EXPORT min(double x, double y)
Returns the minimum of two doubles or the first argument if both are equal.