27 #include <QDialogButtonBox>
28 #include <QPushButton>
29 #include <QMessageBox>
40 mMessageBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
41 verticalLayout->insertWidget( 0, mMessageBar );
45 mTextRenderFormatComboBox->addItem( tr(
"Always Render Labels as Paths (Recommended)" ),
static_cast< int >( Qgis::TextRenderFormat::AlwaysOutlines ) );
46 mTextRenderFormatComboBox->addItem( tr(
"Always Render Labels as Text" ),
static_cast< int >( Qgis::TextRenderFormat::AlwaysText ) );
52 mPlacementVersionComboBox->setCurrentIndex( mPlacementVersionComboBox->findData( mPreviousEngineVersion ) );
53 connect( mPlacementVersionComboBox, &QComboBox::currentTextChanged,
this, [ = ]()
57 mMessageBar->pushMessage( QString(), tr(
"Version changes will alter label placement in the project." ), Qgis::MessageLevel::Warning );
61 spinCandLine->setClearValue( 5 );
62 spinCandPolygon->setClearValue( 2.5 );
74 mUnplacedColorButton->setAllowOpacity(
false );
75 mUnplacedColorButton->setDefaultColor( QColor( 255, 0, 0 ) );
76 mUnplacedColorButton->setWindowTitle( tr(
"Unplaced Label Color" ) );
78 mTextRenderFormatComboBox->setCurrentIndex( mTextRenderFormatComboBox->findData(
static_cast< int >( engineSettings.
defaultTextRenderFormat() ) ) );
90 mWidgetMenu =
new QMenu(
this );
91 QAction *resetAction =
new QAction( tr(
"Restore Defaults" ),
this );
92 mWidgetMenu->addAction( resetAction );
94 QAction *helpAction =
new QAction(
QgsApplication::getThemeIcon( QStringLiteral(
"/mActionHelpContents.svg" ) ), tr(
"Help…" ),
this );
95 mWidgetMenu->addAction( helpAction );
106 return tr(
"Additional Options" );
135 spinCandLine->setValue( 5 );
136 spinCandPolygon->setValue( 10 );
137 chkShowCandidates->setChecked(
false );
138 chkShowAllLabels->setChecked(
false );
140 mTextRenderFormatComboBox->setCurrentIndex( mTextRenderFormatComboBox->findData(
static_cast< int >( Qgis::TextRenderFormat::AlwaysOutlines ) ) );
146 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/vector_properties.html#setting-the-automated-placement-engine" ) );
157 setWindowTitle( mWidget->windowTitle() );
158 QVBoxLayout *vLayout =
new QVBoxLayout();
159 vLayout->addWidget( mWidget );
160 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::RestoreDefaults, Qt::Horizontal );
161 connect( bbox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
162 connect( bbox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
164 connect( bbox->button( QDialogButtonBox::RestoreDefaults ), &QAbstractButton::clicked,
166 vLayout->addWidget( bbox );
167 setLayout( vLayout );
169 setObjectName( QStringLiteral(
"QgsLabelSettingsWidgetDialog" ) );