16 #include <QGridLayout>    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 );
    59   mGroupBox->setChecked( hasScaleVisibility );
    64   return mGroupBox->isChecked();
 void setMaximumScale(double scale)
Set the maximum 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. 
 
bool hasScaleVisibility() const
Return true if scale based visibilty is enabled. 
 
Map canvas is a class for displaying all GIS data types on a canvas. 
 
void setScaleVisiblity(bool hasScaleVisibility)
Set whether scale based visibility is enabled. 
 
double maximumScale() const
Returns the selected maximum scale, or 0 if maximum scale is not set. 
 
void setMinimumScale(double scale)
Set the minimum scale, or 0 to indicate the minimum is not set. 
 
double minimumScale() const
Returns the selected minimum scale, or 0 if minimum scale is not set.