17#include <QDialogButtonBox>
27 if ( !title.isEmpty() )
29 setWindowTitle( title );
32 QGridLayout *dlgLayout =
new QGridLayout(
this );
35 mGroupBox =
new QGroupBox(
this );
36 mGroupBox->setCheckable(
true );
37 mGroupBox->setTitle( tr(
"Scale visibility " ) );
39 QGridLayout *gbLayout =
new QGridLayout( mGroupBox );
47 gbLayout->addWidget( mScaleWidget, 0, 0 );
49 QDialogButtonBox *buttonBox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok, Qt::Horizontal,
this );
50 connect( buttonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
51 connect( buttonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
53 dlgLayout->addWidget( mGroupBox, 0, 0 );
54 dlgLayout->addWidget( buttonBox, 1, 0 );
64 return mGroupBox->isChecked();
Map canvas is a class for displaying all GIS data types on a canvas.
void setMaximumScale(double scale)
Set the maximum scale, or 0 to indicate the minimum is not set.
void setMinimumScale(double scale)
Set the minimum scale, or 0 to indicate the minimum is not set.
QgsScaleVisibilityDialog(QWidget *parent=nullptr, const QString &title=QString(), QgsMapCanvas *mapCanvas=nullptr)
Constructor for QgsScaleVisibilityDialog, with specified dialog title.
void setScaleVisiblity(bool hasScaleVisibility)
Set whether scale based visibility is enabled.