QGIS API Documentation  2.99.0-Master (e077efd)
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 class QgsMapCanvas;
23 class QgsScaleWidget;
24 
28 class GUI_EXPORT QgsScaleRangeWidget : public QWidget
29 {
30  Q_OBJECT
31 
32  public:
33  explicit QgsScaleRangeWidget( QWidget *parent = nullptr );
35 
37 
42  void setMapCanvas( QgsMapCanvas* mapCanvas );
43 
45  double minimumScale();
46 
48  double maximumScale();
49 
54  double minimumScaleDenom();
55 
60  double maximumScaleDenom();
61 
63  void reloadProjectScales();
64 
65  public slots:
66 
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:106
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