16 #include <QHBoxLayout> 25 QHBoxLayout *layout =
new QHBoxLayout(
this );
26 layout->setContentsMargins( 0, 0, 0, 0 );
27 layout->setSpacing( 6 );
30 layout->addWidget( mScaleComboBox );
32 mCurrentScaleButton =
new QToolButton(
this );
33 mCurrentScaleButton->setToolTip( tr(
"Set to current canvas scale" ) );
35 layout->addWidget( mCurrentScaleButton );
36 mCurrentScaleButton->hide();
45 mCurrentScaleButton->setVisible( mShowCurrentScaleButton && mCanvas );
51 mCurrentScaleButton->setVisible( mShowCurrentScaleButton && mCanvas );
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
void setScale(double scale)
Set the selected scale from a double.
Map canvas is a class for displaying all GIS data types on a canvas.
void scaleChanged(double scale)
Emitted when user has finished editing/selecting a new scale.
double scale() const
Returns the last reported scale of the canvas.
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...