16#ifndef QGSSCALEWIDGET_H
17#define QGSSCALEWIDGET_H
37 Q_PROPERTY(
bool showCurrentScaleButton READ showCurrentScaleButton WRITE setShowCurrentScaleButton )
38 Q_PROPERTY(
bool scale READ scale WRITE setScale NOTIFY scaleChanged )
39 Q_PROPERTY(
bool minScale READ minScale WRITE setMinScale )
54 void setShowCurrentScaleButton(
bool showCurrentScaleButton );
60 bool showCurrentScaleButton() {
return mShowCurrentScaleButton; }
71 QString
scaleString()
const {
return mScaleComboBox->scaleString(); }
77 bool setScaleString(
const QString &
string ) {
return mScaleComboBox->setScaleString(
string ); }
84 double scale()
const {
return mScaleComboBox->scale(); }
101 double minScale()
const {
return mScaleComboBox->minScale(); }
127 void setAllowNull(
bool allowNull );
136 bool allowNull()
const;
146 void setPredefinedScales(
const QVector<double> &scales );
155 void setScale(
double scale );
161 void updateScales(
const QStringList &scales = QStringList() ) { mScaleComboBox->updateScales( scales ); }
167 void setScaleFromCanvas();
175 void setMinScale(
double scale ) { mScaleComboBox->setMinScale( scale ); }
198 void menuAboutToShow();
202 QToolButton *mCurrentScaleButton =
nullptr;
204 QMenu *mMenu =
nullptr;
205 bool mShowCurrentScaleButton =
false;
Map canvas is a class for displaying all GIS data types on a canvas.
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...
static QString toString(double scale)
Helper function to convert a scale double to scale string.
static double toDouble(const QString &string, bool *ok=nullptr)
Helper function to convert a scale string to double.