16#ifndef QGSSCALEWIDGET_H
17#define QGSSCALEWIDGET_H
70 QString
scaleString()
const {
return mScaleComboBox->scaleString(); }
76 bool setScaleString(
const QString &
string ) {
return mScaleComboBox->setScaleString(
string ); }
83 double scale()
const {
return mScaleComboBox->scale(); }
100 double minScale()
const {
return mScaleComboBox->minScale(); }
126 void setAllowNull(
bool allowNull );
135 bool allowNull()
const;
145 void setPredefinedScales(
const QVector<double> &scales );
154 void setScale(
double scale );
160 void updateScales(
const QStringList &scales = QStringList() ) { mScaleComboBox->updateScales( scales ); }
166 void setScaleFromCanvas();
197 void menuAboutToShow();
201 QToolButton *mCurrentScaleButton =
nullptr;
203 QMenu *mMenu =
nullptr;
204 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 double toDouble(const QString &string, bool *ok=nullptr)
Helper function to convert a scale string to double.
static QString toString(double scale, QgsScaleComboBox::RatioMode mode=QgsScaleComboBox::RatioMode::ForceUnitNumerator)
Helper function to convert a scale double to scale string.