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 );
56 return mScaleComboBox->
isNull();
void setAllowNull(bool allowNull)
Sets whether the scale combobox can be set to a NULL value.
bool isNull() const
Returns true if the combo box is currently set to a "null" value.
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.
void setNull()
Sets the combo box to the null value.
double scale() const
Returns the last reported scale of the canvas.
bool allowNull() const
Returns true if the combobox can be set to a NULL value.
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...