QGIS API Documentation  2.99.0-Master (ba079d8)
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 
30 class GUI_EXPORT QgsScaleRangeWidget : public QWidget
31 {
32  Q_OBJECT
33 
34  public:
35  explicit QgsScaleRangeWidget( QWidget *parent SIP_TRANSFERTHIS = 0 );
36 
38 
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:
67 
71  void setMinimumScale( double scale );
72 
76  void setMaximumScale( double scale );
77 
78  void setScaleRange( double min, double max );
79 
80  signals:
81 
87  void rangeChanged( double min, double max );
88 
89  private slots:
90 
91  void emitRangeChanged();
92 
93  private:
95  QgsMapCanvas *mCanvas = nullptr;
96 
97  // ui
98  QGridLayout *mLayout = nullptr;
99  QLabel *mMaximumScaleIconLabel = nullptr;
100  QLabel *mMinimumScaleIconLabel = nullptr;
101  QgsScaleWidget *mMaximumScaleWidget = nullptr;
102  QgsScaleWidget *mMinimumScaleWidget = nullptr;
103 };
104 
105 #endif // QGSSCALERANGEWIDGET_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:34
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:73
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