26 : QgsLabelingGui( mapCanvas, parent, layer )
34 QWidget *labelWithWidget =
new QWidget();
35 QGridLayout *gLayout =
new QGridLayout();
36 gLayout->setContentsMargins( 0, 0, 0, 0 );
37 gLayout->addWidget(
new QLabel( tr(
"Value" ) ), 0, 0 );
40 gLayout->addWidget( mBandCombo, 0, 1 );
41 gLayout->setColumnStretch( 0, 1 );
42 gLayout->setColumnStretch( 1, 2 );
44 gLayout->addWidget(
new QLabel( tr(
"Number format" ) ), 1, 0 );
46 QPushButton *numberFormatButton =
new QPushButton( tr(
"Customize" ) );
47 connect( numberFormatButton, &QPushButton::clicked,
this, &QgsRasterLabelSettingsWidget::changeNumberFormat );
49 gLayout->addWidget( numberFormatButton, 1, 1 );
51 gLayout->addWidget(
new QLabel( tr(
"Resample over" ) ), 2, 0 );
53 mResampleOverSpin->setMinimum( 1 );
54 mResampleOverSpin->setMaximum( 128 );
56 mResampleOverSpin->setSuffix( tr(
" pixels" ) );
57 connect( mResampleOverSpin, qOverload<int>( &QgsSpinBox::valueChanged ),
this, &QgsRasterLabelSettingsWidget::widgetChanged );
58 gLayout->addWidget( mResampleOverSpin, 2, 1 );
60 gLayout->addWidget(
new QLabel( tr(
"Resample using" ) ), 3, 0 );
61 mResampleMethodComboBox =
new QComboBox();
70 connect( mResampleMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, &QgsRasterLabelSettingsWidget::widgetChanged );
71 gLayout->addWidget( mResampleMethodComboBox, 3, 1 );
73 labelWithWidget->setLayout( gLayout );
75 mStackedWidgetLabelWith->addWidget( labelWithWidget );
76 mStackedWidgetLabelWith->setCurrentWidget( labelWithWidget );
80 const int prevIndex = mOptionsTab->currentIndex();
82 setPropertyOverrideButtonsVisible(
true );
86 mCalloutItem =
nullptr;
90 mOptionsTab->removeTab( mOptionsTab->indexOf( calloutsTab ) );
91 mOptionsTab->removeTab( mOptionsTab->indexOf( maskTab ) );
93 mLabelStackedWidget->removeWidget( mLabelPage_Callouts );
94 mLabelStackedWidget->removeWidget( mLabelPage_Mask );
105 mLabelStackedWidget->setCurrentIndex( prevIndex - 1 );
106 mOptionsTab->setCurrentIndex( prevIndex - 1 );
111 mLabelStackedWidget->setCurrentIndex( prevIndex - 2 );
112 mOptionsTab->setCurrentIndex( prevIndex - 2 );
117 mLabelStackedWidget->setCurrentIndex( 0 );
118 mOptionsTab->setCurrentIndex( 0 );
126 mDirectSymbolsFrame->hide();
127 mFormatNumFrame->hide();
128 mFormatNumChkBx->hide();
129 mFormatNumDDBtn->hide();
130 mCheckBoxSubstituteText->hide();
131 mToolButtonConfigureSubstitutes->hide();
132 mLabelWrapOnCharacter->hide();
133 wrapCharacterEdit->hide();
134 mWrapCharDDBtn->hide();
135 mLabelWrapLinesTo->hide();
136 mAutoWrapLengthSpinBox->hide();
137 mAutoWrapLengthDDBtn->hide();
138 mAutoWrapTypeComboBox->hide();
139 mFontMultiLineLabel->hide();
140 mFontMultiLineAlignComboBox->hide();
141 mFontMultiLineAlignDDBtn->hide();
142 mGeometryGeneratorGroupBox->hide();
143 mObstaclesGroupBox->hide();
144 mPlacementDDGroupBox->hide();
145 mPlacementGroupBox->hide();
146 mInferiorPlacementWidget->hide();
147 mLabelRenderingDDFrame->hide();
148 mUpsidedownFrame->hide();
149 mLabelEveryPartWidget->hide();
150 mFramePixelSizeVisibility->hide();
153 mMinSizeFrame->show();
154 mMinSizeLabel->setText( tr(
"Suppress labeling of pixels smaller than" ) );
156 mLimitLabelChkBox->setText( tr(
"Limit number of pixels to be labeled to" ) );
159 mPrioritySlider->setRange( 0, 100 );
160 mPrioritySlider->setTickInterval( 10 );
171 setFormat( simpleLabeling->textFormat() );
172 mBandCombo->
setBand( simpleLabeling->band() );
173 mPrioritySlider->setValue(
static_cast<int>( 100 - simpleLabeling->priority() * 100 ) );
175 mComboOverlapHandling->setCurrentIndex( mComboOverlapHandling->findData(
static_cast<int>( simpleLabeling->placementSettings().overlapHandling() ) ) );
176 mZIndexSpinBox->setValue( simpleLabeling->zIndex() );
178 mNumberFormat.reset( format->clone() );
180 mLimitLabelChkBox->setChecked( simpleLabeling->thinningSettings().limitNumberOfLabelsEnabled() );
181 mLimitLabelSpinBox->setValue( simpleLabeling->thinningSettings().maximumNumberLabels() );
182 mMinSizeSpinBox->setValue( simpleLabeling->thinningSettings().minimumFeatureSize() );
184 mScaleBasedVisibilityChkBx->setChecked( simpleLabeling->hasScaleBasedVisibility() );
185 mMinScaleWidget->setScale( simpleLabeling->minimumScale() );
186 mMaxScaleWidget->setScale( simpleLabeling->maximumScale() );
188 mResampleOverSpin->setValue( simpleLabeling->resampleOver() );
189 mResampleMethodComboBox->setCurrentIndex( mResampleMethodComboBox->findData( QVariant::fromValue( simpleLabeling->resampleMethod() ) ) );
199 simpleLabeling->setTextFormat( format() );
200 simpleLabeling->setBand( mBandCombo->
currentBand() );
201 simpleLabeling->setPriority( 1.0 - mPrioritySlider->value() / 100.0 );
202 simpleLabeling->placementSettings().setOverlapHandling(
static_cast<Qgis::LabelOverlapHandling>( mComboOverlapHandling->currentData().toInt() ) );
203 simpleLabeling->setZIndex( mZIndexSpinBox->value() );
204 simpleLabeling->setNumericFormat( mNumberFormat->clone() );
206 simpleLabeling->thinningSettings().setLimitNumberLabelsEnabled( mLimitLabelChkBox->isChecked() );
207 simpleLabeling->thinningSettings().setMaximumNumberLabels( mLimitLabelSpinBox->value() );
208 simpleLabeling->thinningSettings().setMinimumFeatureSize( mMinSizeSpinBox->value() );
210 simpleLabeling->setScaleBasedVisibility( mScaleBasedVisibilityChkBx->isChecked() );
211 simpleLabeling->setMinimumScale( mMinScaleWidget->scale() );
212 simpleLabeling->setMaximumScale( mMaxScaleWidget->scale() );
214 simpleLabeling->setResampleOver( mResampleOverSpin->value() );