30 mLayout =
new QGridLayout(
this );
31 mLayout->setContentsMargins( 0, 0, 0, 0 );
33 QLabel *minLbl =
new QLabel( tr(
"Minimum (exclusive)" ),
this );
34 minLbl->setWordWrap(
true );
35 minLbl->setAlignment( Qt::AlignTop );
36 minLbl->setToolTip( tr(
"Minimum scale, i.e. most \"zoomed out\". "
37 "This limit is exclusive, that means the layer will not be displayed on this scale." ) );
38 QLabel *maxLbl =
new QLabel( tr(
"Maximum (inclusive)" ),
this );
39 maxLbl->setWordWrap(
true );
40 maxLbl->setAlignment( Qt::AlignTop );
41 maxLbl->setToolTip( tr(
"Maximum scale, i.e. most \"zoomed in\". "
42 "This limit is inclusive, that means the layer will be displayed on this scale." ) );
45 mMinimumScaleIconLabel =
new QLabel(
this );
46 mMinimumScaleIconLabel->setPixmap(
QgsApplication::getThemeIcon( QStringLiteral(
"/mActionZoomOut.svg" ) ).pixmap( QSize( iconSize, iconSize ) ) );
47 mMaximumScaleIconLabel =
new QLabel(
this );
48 mMaximumScaleIconLabel->setPixmap(
QgsApplication::getThemeIcon( QStringLiteral(
"/mActionZoomIn.svg" ) ).pixmap( QSize( iconSize, iconSize ) ) );
53 mMinimumScaleWidget->setShowCurrentScaleButton(
true );
54 mMaximumScaleWidget->setShowCurrentScaleButton(
true );
57 mMinimumScaleWidget->setScale( 100000 );
58 mMaximumScaleWidget->setScale( 1000 );
60 mLayout->addWidget( minLbl, 0, 0, 1, 2 );
61 mLayout->addWidget( mMinimumScaleIconLabel, 1, 0 );
62 mLayout->addWidget( mMinimumScaleWidget, 1, 1 );
63 mLayout->addWidget( maxLbl, 0, 2, 1, 2 );
64 mLayout->addWidget( mMaximumScaleIconLabel, 1, 2 );
65 mLayout->addWidget( mMaximumScaleWidget, 1, 3 );
67 mLayout->setColumnStretch( 0, 0 );
68 mLayout->setColumnStretch( 1, 3 );
69 mLayout->setColumnStretch( 2, 0 );
70 mLayout->setColumnStretch( 3, 3 );