QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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
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 "qgis_gui.h"
20#include "qgis_sip.h"
21
22#include <QGridLayout>
23#include <QLabel>
24
25class QgsMapCanvas;
26class QgsScaleWidget;
27
33class GUI_EXPORT QgsScaleRangeWidget : public QWidget
34{
35 Q_OBJECT
36 Q_PROPERTY( double minimumScale READ minimumScale WRITE setMinimumScale )
37 Q_PROPERTY( double maximumScale READ maximumScale WRITE setMaximumScale )
38
39 public:
40
44 explicit QgsScaleRangeWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
45
50 void setMapCanvas( QgsMapCanvas *canvas );
51
58 double minimumScale() const;
59
66 double maximumScale() const;
67
72
73 public slots:
74
87 void setMinimumScale( double scale );
88
101 void setMaximumScale( double scale );
102
110 void setScaleRange( double min, double max );
111
112 signals:
113
119 void rangeChanged( double min, double max );
120
121 private slots:
122
123 void emitRangeChanged();
124
125 private:
126 // ui
127 QGridLayout *mLayout = nullptr;
128 QLabel *mMaximumScaleIconLabel = nullptr;
129 QLabel *mMinimumScaleIconLabel = nullptr;
130 QgsScaleWidget *mMaximumScaleWidget = nullptr;
131 QgsScaleWidget *mMinimumScaleWidget = nullptr;
132};
133
134#endif // QGSSCALERANGEWIDGET_H
Map canvas is a class for displaying all GIS data types on a canvas.
QgsScaleRangeWidget(QWidget *parent=nullptr)
Constructor for QgsScaleRangeWidget.
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas which will be used for the current scale buttons.
void setScaleRange(double min, double max)
Sets the scale range, from min scale (i.e.
void reloadProjectScales()
Call to reload the preset scales from the current project and apply them to the 2 scales combo boxes.
void setMinimumScale(double scale)
Set the minimum scale (i.e.
void rangeChanged(double min, double max)
Emitted when the scale range set in the widget is changed.
void setMaximumScale(double scale)
Set the maximum scale (i.e.
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53