25 mLayout =
new QGridLayout(
this );
26 mLayout->setContentsMargins( 0, 0, 0, 0 );
28 QLabel *minLbl =
new QLabel( tr(
"Minimum (exclusive)" ),
this );
29 minLbl->setWordWrap(
true );
30 minLbl->setAlignment( Qt::AlignTop );
31 minLbl->setToolTip( tr(
"Minimum scale, i.e. most \"zoomed out\". " 32 "This limit is exclusive, that means the layer will not be displayed on this scale." ) );
33 QLabel *maxLbl =
new QLabel( tr(
"Maximum (inclusive)" ),
this );
34 maxLbl->setWordWrap(
true );
35 maxLbl->setAlignment( Qt::AlignTop );
36 maxLbl->setToolTip( tr(
"Maximum scale, i.e. most \"zoomed in\". " 37 "This limit is inclusive, that means the layer will be displayed on this scale." ) );
39 mMinimumScaleIconLabel =
new QLabel(
this );
41 mMaximumScaleIconLabel =
new QLabel(
this );
51 mMinimumScaleWidget->
setScale( 100000 );
52 mMaximumScaleWidget->
setScale( 1000 );
54 mLayout->addWidget( minLbl, 0, 0, 1, 2 );
55 mLayout->addWidget( mMinimumScaleIconLabel, 1, 0 );
56 mLayout->addWidget( mMinimumScaleWidget, 1, 1 );
57 mLayout->addWidget( maxLbl, 0, 2, 1, 2 );
58 mLayout->addWidget( mMaximumScaleIconLabel, 1, 2 );
59 mLayout->addWidget( mMaximumScaleWidget, 1, 3 );
61 mLayout->setColumnStretch( 0, 0 );
62 mLayout->setColumnStretch( 1, 3 );
63 mLayout->setColumnStretch( 2, 0 );
64 mLayout->setColumnStretch( 3, 3 );
89 mMinimumScaleWidget->
setScale( scale );
94 return mMinimumScaleWidget->
scale();
99 mMaximumScaleWidget->
setScale( scale );
104 return mMaximumScaleWidget->
scale();
113 void QgsScaleRangeWidget::emitRangeChanged()
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
Map canvas is a class for displaying all GIS data types on a canvas.
static QPixmap getThemePixmap(const QString &name)
Helper to get a theme icon as a pixmap.
QStringList readListEntry(const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=nullptr) const
Key value accessors.
static QgsProject * instance()
Returns the QgsProject singleton instance.