QGIS API Documentation  2.17.0-Master (eef6f05)
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 
52  double minimumScaleDenom();
53 
55  double maximumScaleDenom();
56 
58  void reloadProjectScales();
59 
60  public slots:
61  void setMinimumScale( double scale );
62 
63  void setMaximumScale( double scale );
64 
65  void setScaleRange( double min, double max );
66 
67  signals:
68 
74  void rangeChanged( double min, double max );
75 
76  private slots:
77 
78  void emitRangeChanged();
79 
80  private:
82  QgsMapCanvas* mCanvas;
83 
84  // ui
85  QGridLayout* mLayout;
86  QLabel* mMaximumScaleIconLabel;
87  QLabel* mMinimumScaleIconLabel;
88  QgsScaleWidget* mMaximumScaleWidget;
89  QgsScaleWidget* mMinimumScaleWidget;
90 };
91 
92 #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.