41#include "moc_qgsvectorlayerproperties.cpp"
78#include <QDesktopServices>
88#include <QColorDialog>
91#include <QRegularExpressionValidator>
102 , mMessageBar( messageBar )
104 , mOriginalSubsetSQL( lyr->subsetString() )
107 connect( pbnQueryBuilder, &QPushButton::clicked,
this, &QgsVectorLayerProperties::pbnQueryBuilder_clicked );
108 connect( pbnIndex, &QPushButton::clicked,
this, &QgsVectorLayerProperties::pbnIndex_clicked );
110 connect( pbnUpdateExtents, &QPushButton::clicked,
this, &QgsVectorLayerProperties::pbnUpdateExtents_clicked );
111 connect( mButtonAddJoin, &QPushButton::clicked,
this, &QgsVectorLayerProperties::mButtonAddJoin_clicked );
112 connect( mButtonEditJoin, &QPushButton::clicked,
this, &QgsVectorLayerProperties::mButtonEditJoin_clicked );
113 connect( mJoinTreeWidget, &QTreeWidget::itemDoubleClicked,
this, &QgsVectorLayerProperties::mJoinTreeWidget_itemDoubleClicked );
114 connect( mButtonRemoveJoin, &QPushButton::clicked,
this, &QgsVectorLayerProperties::mButtonRemoveJoin_clicked );
115 connect( mButtonAddWmsDimension, &QPushButton::clicked,
this, &QgsVectorLayerProperties::mButtonAddWmsDimension_clicked );
116 connect( mButtonEditWmsDimension, &QPushButton::clicked,
this, &QgsVectorLayerProperties::mButtonEditWmsDimension_clicked );
117 connect( mWmsDimensionsTreeWidget, &QTreeWidget::itemDoubleClicked,
this, &QgsVectorLayerProperties::mWmsDimensionsTreeWidget_itemDoubleClicked );
118 connect( mButtonRemoveWmsDimension, &QPushButton::clicked,
this, &QgsVectorLayerProperties::mButtonRemoveWmsDimension_clicked );
119 connect( mSimplifyDrawingGroupBox, &QGroupBox::toggled,
this, &QgsVectorLayerProperties::mSimplifyDrawingGroupBox_toggled );
120 connect( buttonRemoveMetadataUrl, &QPushButton::clicked,
this, &QgsVectorLayerProperties::removeSelectedMetadataUrl );
121 connect( buttonAddMetadataUrl, &QPushButton::clicked,
this, &QgsVectorLayerProperties::addMetadataUrl );
122 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsVectorLayerProperties::showHelp );
131 mBtnStyle =
new QPushButton( tr(
"Style" ),
this );
132 QMenu *menuStyle =
new QMenu(
this );
133 mActionLoadStyle =
new QAction( tr(
"Load Style…" ),
this );
136 mActionSaveStyle =
new QAction( tr(
"Save Current Style…" ),
this );
139 mActionSaveMultipleStyles =
new QAction( tr(
"Save Multiple Styles…" ),
this );
140 connect( mActionSaveMultipleStyles, &QAction::triggered,
this, &QgsVectorLayerProperties::saveMultipleStylesAs );
142 mSourceGroupBox->hide();
145 connect( menuStyle, &QMenu::aboutToShow,
this, &QgsVectorLayerProperties::aboutToShowStyleMenu );
146 buttonBox->addButton(
mBtnStyle, QDialogButtonBox::ResetRole );
167 mMapTipFieldComboBox->setLayer( lyr );
168 mDisplayExpressionWidget->setLayer( lyr );
169 mDisplayExpressionWidget->registerExpressionContextGenerator(
this );
172 connect( mMapTipInsertFieldButton, &QAbstractButton::clicked,
this, &QgsVectorLayerProperties::insertField );
173 connect( mMapTipInsertExpressionButton, &QAbstractButton::clicked,
this, &QgsVectorLayerProperties::insertOrEditExpression );
178 connect( mEnableMapTips, &QAbstractButton::toggled, mHtmlMapTipGroupBox, &QWidget::setEnabled );
181 QVBoxLayout *layout =
nullptr;
186 layout =
new QVBoxLayout( labelingFrame );
187 layout->setContentsMargins( 0, 0, 0, 0 );
189 labelingDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
191 layout->addWidget( labelingDialog );
192 labelingFrame->setLayout( layout );
195 layout =
new QVBoxLayout( mMaskingFrame );
196 layout->setContentsMargins( 0, 0, 0, 0 );
197 mMaskingWidget =
new QgsMaskingWidget( mMaskingFrame );
198 mMaskingWidget->setLayer( mLayer );
199 mMaskingWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
200 layout->addWidget( mMaskingWidget );
201 mMaskingFrame->setLayout( layout );
205 labelingDialog =
nullptr;
206 mOptsPage_Labels->setEnabled(
false );
207 mOptsPage_Masks->setEnabled(
false );
208 mGeomGroupBox->setEnabled(
false );
209 mGeomGroupBox->setVisible(
false );
210 mCrsGroupBox->setEnabled(
false );
211 mCrsGroupBox->setVisible(
false );
215 QVBoxLayout *actionLayout =
new QVBoxLayout( actionOptionsFrame );
216 actionLayout->setContentsMargins( 0, 0, 0, 0 );
218 mActionDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
219 actionLayout->addWidget( mActionDialog );
222 mSourceFieldsPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
223 mSourceFieldsFrame->setLayout(
new QVBoxLayout( mSourceFieldsFrame ) );
224 mSourceFieldsFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
225 mSourceFieldsFrame->layout()->addWidget( mSourceFieldsPropertiesDialog );
230 mAttributesFormPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
231 mAttributesFormFrame->setLayout(
new QVBoxLayout( mAttributesFormFrame ) );
232 mAttributesFormFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
233 mAttributesFormFrame->layout()->addWidget( mAttributesFormPropertiesDialog );
236 QVBoxLayout *metadataLayout =
new QVBoxLayout( metadataFrame );
237 metadataLayout->setContentsMargins( 0, 0, 0, 0 );
239 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
241 metadataLayout->addWidget( mMetadataWidget );
242 metadataFrame->setLayout( metadataLayout );
244 QVBoxLayout *temporalLayout =
new QVBoxLayout( temporalFrame );
245 temporalLayout->setContentsMargins( 0, 0, 0, 0 );
247 temporalLayout->addWidget( mTemporalWidget );
251 mBtnMetadata =
new QPushButton( tr(
"Metadata" ),
this );
252 QMenu *menuMetadata =
new QMenu(
this );
255 menuMetadata->addSeparator();
259 buttonBox->addButton(
mBtnMetadata, QDialogButtonBox::ResetRole );
261 mSelectionColorButton->setAllowOpacity(
true );
262 mSelectionColorButton->setColorDialogTitle( tr(
"Override Selection Color" ) );
268 connect( mRadioOverrideSelectionColor, &QRadioButton::toggled, mSelectionColorButton, &QWidget::setEnabled );
269 mSelectionColorButton->setEnabled(
false );
270 connect( mRadioOverrideSelectionSymbol, &QRadioButton::toggled, mSelectionSymbolButton, &QWidget::setEnabled );
287 mSelectionSymbolButton->setEnabled(
false );
288 mRadioDefaultSelectionColor->setChecked(
true );
291 QVBoxLayout *diagLayout =
new QVBoxLayout( mDiagramFrame );
292 diagLayout->setContentsMargins( 0, 0, 0, 0 );
294 diagramPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
296 diagLayout->addWidget( diagramPropertiesDialog );
297 mDiagramFrame->setLayout( diagLayout );
307 pbnIndex->setEnabled(
false );
311 pbnIndex->setEnabled(
false );
312 pbnIndex->setText( tr(
"Spatial Index Exists" ) );
319 int encindex = cboProviderEncoding->findText( enc );
322 cboProviderEncoding->insertItem( 0, enc );
325 cboProviderEncoding->setCurrentIndex( encindex );
327 else if ( mLayer->
providerType() == QLatin1String(
"ogr" ) )
332 cboProviderEncoding->setEnabled(
false );
337 mDataSourceEncodingFrame->hide();
341 mCrsSelector->setCrs( mLayer->
crs() );
344 const QList<QgsVectorLayerJoinInfo> &joins = mLayer->
vectorJoins();
347 addJoinToTreeWidget( join );
353 mLegendWidget->setMapCanvas(
mCanvas );
354 mLegendWidget->setLayer( mLayer );
355 mLegendConfigEmbeddedWidget->setLayer( mLayer );
361 mLayerShortNameLineEdit->setValidator( shortNameValidator );
370 mLayerDataUrlFormatComboBox->setCurrentIndex(
371 mLayerDataUrlFormatComboBox->findText(
380 tableViewMetadataUrl->setSelectionMode( QAbstractItemView::SingleSelection );
381 tableViewMetadataUrl->setSelectionBehavior( QAbstractItemView::SelectRows );
382 tableViewMetadataUrl->horizontalHeader()->setStretchLastSection(
true );
383 tableViewMetadataUrl->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
385 mMetadataUrlModel =
new QStandardItemModel( tableViewMetadataUrl );
386 mMetadataUrlModel->clear();
387 mMetadataUrlModel->setColumnCount( 3 );
388 QStringList metadataUrlHeaders;
389 metadataUrlHeaders << tr(
"URL" ) << tr(
"Type" ) << tr(
"Format" );
390 mMetadataUrlModel->setHorizontalHeaderLabels( metadataUrlHeaders );
391 tableViewMetadataUrl->setModel( mMetadataUrlModel );
392 tableViewMetadataUrl->setItemDelegate(
new MetadataUrlItemDelegate(
this ) );
397 const int row = mMetadataUrlModel->rowCount();
398 mMetadataUrlModel->setItem( row, 0,
new QStandardItem( metaUrl.url ) );
399 mMetadataUrlModel->setItem( row, 1,
new QStandardItem( metaUrl.type ) );
400 mMetadataUrlModel->setItem( row, 2,
new QStandardItem( metaUrl.format ) );
404 mLayerLegendUrlLineEdit->setText( mLayer->
legendUrl() );
405 mLayerLegendUrlFormatComboBox->setCurrentIndex(
406 mLayerLegendUrlFormatComboBox->findText(
413 const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &wmsDims = serverProperties->
wmsDimensions();
416 addWmsDimensionInfoToTreeWidget( dim );
420 myStyle.append( QStringLiteral(
"body { margin: 10px; }\n " ) );
421 teMetadataViewer->clear();
422 teMetadataViewer->document()->setDefaultStyleSheet( myStyle );
423 teMetadataViewer->setHtml( htmlMetadata() );
424 teMetadataViewer->setOpenLinks(
false );
426 mMetadataFilled =
true;
431 if ( !settings.
contains( QStringLiteral(
"/Windows/VectorLayerProperties/tab" ) ) )
433 settings.
setValue( QStringLiteral(
"Windows/VectorLayerProperties/tab" ),
mOptStackedWidget->indexOf( mOptsPage_Style ) );
436 QList<QgsMapLayer *> dependencySources;
437 const QSet<QgsMapLayerDependency> constDependencies = mLayer->
dependencies();
442 dependencySources << layer;
448 connect(
QgsProject::instance(), &QObject::destroyed,
this, [=] { mLayersDependenciesTreeView->setModel(
nullptr ); } );
449 mLayersDependenciesTreeView->setModel( mLayersDependenciesTreeModel );
451 mRefreshSettingsWidget->setLayer( mLayer );
454 QMenu *menu =
new QMenu(
this );
456 mAuxiliaryLayerActionNew =
new QAction( tr(
"Create" ),
this );
457 menu->addAction( mAuxiliaryLayerActionNew );
458 connect( mAuxiliaryLayerActionNew, &QAction::triggered,
this, &QgsVectorLayerProperties::onAuxiliaryLayerNew );
460 mAuxiliaryLayerActionClear =
new QAction( tr(
"Clear" ),
this );
461 menu->addAction( mAuxiliaryLayerActionClear );
462 connect( mAuxiliaryLayerActionClear, &QAction::triggered,
this, &QgsVectorLayerProperties::onAuxiliaryLayerClear );
464 mAuxiliaryLayerActionDelete =
new QAction( tr(
"Delete" ),
this );
465 menu->addAction( mAuxiliaryLayerActionDelete );
466 connect( mAuxiliaryLayerActionDelete, &QAction::triggered,
this, &QgsVectorLayerProperties::onAuxiliaryLayerDelete );
468 mAuxiliaryLayerActionExport =
new QAction( tr(
"Export" ),
this );
469 menu->addAction( mAuxiliaryLayerActionExport );
472 mAuxiliaryStorageActions->setMenu( menu );
474 connect( mAuxiliaryStorageFieldsDeleteBtn, &QPushButton::clicked,
this, &QgsVectorLayerProperties::onAuxiliaryLayerDeleteField );
475 connect( mAuxiliaryStorageFieldsAddBtn, &QPushButton::clicked,
this, &QgsVectorLayerProperties::onAuxiliaryLayerAddField );
477 updateAuxiliaryStoragePage();
479 mOptsPage_Information->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#information-properties" ) );
480 mOptsPage_Source->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#source-properties" ) );
481 mOptsPage_Style->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#symbology-properties" ) );
482 mOptsPage_Labels->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#labels-properties" ) );
483 mOptsPage_Masks->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#masks-properties" ) );
484 mOptsPage_Diagrams->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#diagrams-properties" ) );
485 mOptsPage_SourceFields->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#fields-properties" ) );
486 mOptsPage_AttributesForm->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#attributes-form-properties" ) );
487 mOptsPage_Joins->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#joins-properties" ) );
488 mOptsPage_AuxiliaryStorage->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#auxiliary-storage-properties" ) );
489 mOptsPage_Actions->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#actions-properties" ) );
490 mOptsPage_Display->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#display-properties" ) );
491 mOptsPage_Rendering->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#rendering-properties" ) );
492 mOptsPage_Temporal->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#temporal-properties" ) );
493 mOptsPage_Variables->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#variables-properties" ) );
494 mOptsPage_Metadata->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#metadata-properties" ) );
495 mOptsPage_DataDependencies->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#dependencies-properties" ) );
496 mOptsPage_Legend->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#legend-properties" ) );
497 mOptsPage_Server->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#qgis-server-properties" ) );
505void QgsVectorLayerProperties::toggleEditing()
510 emit toggleEditing( mLayer );
512 setPbnQueryBuilderEnabled();
515void QgsVectorLayerProperties::insertField()
519 if ( mMapTipFieldComboBox->currentField().isEmpty() )
521 QString expression = QStringLiteral(
"[%\"" );
522 expression += mMapTipFieldComboBox->currentField();
523 expression += QLatin1String(
"\"%]" );
525 mMapTipWidget->insertText( expression );
528void QgsVectorLayerProperties::insertOrEditExpression()
531 int selectionStart = mMapTipWidget->selectionStart();
532 int selectionEnd = mMapTipWidget->selectionEnd();
538 exprDlg.setWindowTitle( tr(
"Insert Expression" ) );
539 if ( exprDlg.exec() == QDialog::Accepted && !exprDlg.expressionText().trimmed().isEmpty() )
540 mMapTipWidget->insertText(
"[%" + exprDlg.expressionText().trimmed() +
"%]" );
542 mMapTipWidget->setLinearSelection( selectionStart, selectionEnd );
545void QgsVectorLayerProperties::addMetadataUrl()
547 const int row = mMetadataUrlModel->rowCount();
548 mMetadataUrlModel->setItem( row, 0,
new QStandardItem( QLatin1String() ) );
549 mMetadataUrlModel->setItem( row, 1,
new QStandardItem( QLatin1String() ) );
550 mMetadataUrlModel->setItem( row, 2,
new QStandardItem( QLatin1String() ) );
553void QgsVectorLayerProperties::removeSelectedMetadataUrl()
555 const QModelIndexList selectedRows = tableViewMetadataUrl->selectionModel()->selectedRows();
556 if ( selectedRows.empty() )
558 mMetadataUrlModel->removeRow( selectedRows[0].row() );
563 if ( !mSourceWidget )
568 QHBoxLayout *layout =
new QHBoxLayout();
569 layout->addWidget( mSourceWidget );
570 mSourceGroupBox->setLayout( layout );
572 mSourceGroupBox->setTitle( mSourceWidget->
groupTitle() );
574 mSourceGroupBox->show();
577 buttonBox->button( QDialogButtonBox::Apply )->setEnabled( isValid );
578 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( isValid );
590 mLayerOrigNameLineEdit->setText( mLayer->
name() );
591 mBackupCrs = mLayer->
crs();
594 mSubsetGroupBox->setEnabled(
true );
601 txtSubsetSQL->setReadOnly(
true );
602 txtSubsetSQL->setCaretWidth( 0 );
603 txtSubsetSQL->setCaretLineVisible(
false );
604 setPbnQueryBuilderEnabled();
608 mSubsetGroupBox->hide();
618 mScaleRangeWidget->setMapCanvas(
mCanvas );
621 mReferenceScaleWidget->setShowCurrentScaleButton(
true );
622 mReferenceScaleWidget->setMapCanvas(
mCanvas );
623 if ( mUseReferenceScaleGroupBox->isChecked() )
631 mSimplifyDrawingSpinBox->setValue( simplifyMethod.
threshold() );
632 mSimplifyDrawingSpinBox->setClearValue( 1.0 );
637 mSelectionColorButton->setColor( selectionProperties->
selectionColor() );
641 mSelectionSymbolButton->setSymbol( symbol->clone() );
646 mRadioDefaultSelectionColor->setChecked(
true );
653 mRadioOverrideSelectionColor->setChecked(
true );
657 mRadioDefaultSelectionColor->setChecked(
true );
665 mRadioOverrideSelectionSymbol->setChecked(
true );
669 mRadioDefaultSelectionColor->setChecked(
true );
674 QString remark = QStringLiteral(
" (%1)" ).arg( tr(
"Not supported" ) );
678 mSimplifyDrawingAtProvider->setChecked(
false );
679 mSimplifyDrawingAtProvider->setEnabled(
false );
680 if ( !mSimplifyDrawingAtProvider->text().endsWith( remark ) )
681 mSimplifyDrawingAtProvider->setText( mSimplifyDrawingAtProvider->text().append( remark ) );
686 mSimplifyDrawingAtProvider->setEnabled( mSimplifyDrawingGroupBox->isChecked() );
687 if ( mSimplifyDrawingAtProvider->text().endsWith( remark ) )
689 QString newText = mSimplifyDrawingAtProvider->text();
690 newText.chop( remark.size() );
691 mSimplifyDrawingAtProvider->setText( newText );
698 mSimplifyDrawingGroupBox->setChecked(
false );
699 mSimplifyDrawingGroupBox->setEnabled(
false );
706 mSimplifyAlgorithmComboBox->setCurrentIndex( mSimplifyAlgorithmComboBox->findData( QVariant::fromValue( simplifyMethod.
simplifyAlgorithm() ) ) );
709 myScalesList.append( QStringLiteral(
"1:1" ) );
710 mSimplifyMaximumScaleComboBox->updateScales( myScalesList );
711 mSimplifyMaximumScaleComboBox->setScale( simplifyMethod.
maximumScale() );
715 mRefreshSettingsWidget->syncToLayer();
723 updateSymbologyPage();
727 if ( labelingDialog )
730 mSourceFieldsPropertiesDialog->
init();
731 mAttributesFormPropertiesDialog->
init();
734 updateVariableEditor();
736 if ( diagramPropertiesDialog )
742 page->syncToLayer( mLayer );
749 mLegendWidget->setLayer( mLayer );
754 if ( labelingDialog )
758 mBackupCrs = mLayer->
crs();
760 mLegendWidget->applyToLayer();
761 mLegendConfigEmbeddedWidget->applyToLayer();
765 mMetadataFilled =
false;
768 if ( mMaskingWidget )
769 mMaskingWidget->apply();
790 const auto constActions = mActionDialog->
actions();
791 for (
const QgsAction &action : constActions )
798 QVector<QgsAttributeTableConfig::ColumnConfig> columns = attributeTableConfig.
columns();
800 for (
int i = 0; i < columns.size(); ++i )
812 mLayer->
setName( mLayerOrigNameLineEdit->text() );
814 mAttributesFormPropertiesDialog->
apply();
815 mSourceFieldsPropertiesDialog->
apply();
827 diagramPropertiesDialog->
apply();
837 mMetadataFilled =
false;
841 mMetadataFilled =
false;
844 if ( !mLayerOptWfsTitleLineEdit->text().isEmpty() && mLayerOptWfsTitleLineEdit->text() != mLayerTitleLineEdit->text() )
847 mMetadataFilled =
false;
855 mMetadataFilled =
false;
859 mMetadataFilled =
false;
863 mMetadataFilled =
false;
867 mMetadataFilled =
false;
872 mMetadataFilled =
false;
876 mMetadataFilled =
false;
880 QList<QgsMapLayerServerProperties::MetadataUrl> metaUrls;
881 for (
int row = 0; row < mMetadataUrlModel->rowCount(); row++ )
884 metaUrl.
url = mMetadataUrlModel->item( row, 0 )->text();
885 metaUrl.
type = mMetadataUrlModel->item( row, 1 )->text();
886 metaUrl.
format = mMetadataUrlModel->item( row, 2 )->text();
887 metaUrls.append( metaUrl );
888 mMetadataFilled =
false;
893 if ( mLayer->
legendUrl() != mLayerLegendUrlLineEdit->text() )
894 mMetadataFilled =
false;
895 mLayer->
setLegendUrl( mLayerLegendUrlLineEdit->text() );
897 if ( mLayer->
legendUrlFormat() != mLayerLegendUrlFormatComboBox->currentText() )
898 mMetadataFilled =
false;
903 if ( mSimplifyDrawingGroupBox->isChecked() )
906 if ( mSimplifyDrawingSpinBox->value() > 1 )
912 simplifyMethod.
setThreshold( mSimplifyDrawingSpinBox->value() );
914 simplifyMethod.
setMaximumScale( mSimplifyMaximumScaleComboBox->scale() );
924 if ( mSelectionColorButton->color() != mSelectionColorButton->defaultColor() )
928 if (
QgsSymbol *symbol = mSelectionSymbolButton->symbol() )
931 if ( mRadioOverrideSelectionSymbol->isChecked() )
935 else if ( mRadioOverrideSelectionColor->isChecked() )
944 mRefreshSettingsWidget->saveToLayer();
947 mLayer->
setRefreshOnNofifyMessage( mNotificationMessageCheckBox->isChecked() ? mNotifyMessagValueLineEdit->text() : QString() );
953 updateVariableEditor();
956 QSet<QgsMapLayerDependency> deps;
957 const auto checkedLayers = mLayersDependenciesTreeModel->
checkedLayers();
962 QMessageBox::warning(
nullptr, tr(
"Save Dependency" ), tr(
"This configuration introduces a cycle in data dependencies and will be ignored." ) );
971 bool dialogNeedsResync =
false;
974 const QString newSource = mSourceWidget->
sourceUri();
975 if ( newSource != mLayer->
source() )
982 dialogNeedsResync =
true;
988 mSubsetGroupBox->setEnabled(
true );
993 mMetadataFilled =
false;
995 dialogNeedsResync =
true;
999 if ( dialogNeedsResync )
1004 mProjectDirtyBlocker.reset();
1016 const auto constVectorJoins = mLayer->
vectorJoins();
1038 if ( backupCrs != mLayer->
crs() )
1039 mLayer->
setCrs( backupCrs );
1042void QgsVectorLayerProperties::pbnQueryBuilder_clicked()
1051 if ( dialog->exec() )
1064void QgsVectorLayerProperties::pbnIndex_clicked()
1069 setCursor( Qt::WaitCursor );
1071 setCursor( Qt::ArrowCursor );
1074 pbnIndex->setEnabled(
false );
1075 pbnIndex->setText( tr(
"Spatial Index Exists" ) );
1076 QMessageBox::information(
this, tr(
"Spatial Index" ), tr(
"Creation of spatial index successful" ) );
1080 QMessageBox::warning(
this, tr(
"Spatial Index" ), tr(
"Creation of spatial index failed" ) );
1085QString QgsVectorLayerProperties::htmlMetadata()
1094 mMetadataFilled =
false;
1098void QgsVectorLayerProperties::saveMultipleStylesAs()
1101 dlg.setSaveOnlyCurrentStyle(
false );
1110 const QListWidget *stylesWidget { dlg.stylesWidget() };
1113 QStringList stylesSelected;
1114 for (
int i = 0; i < stylesWidget->count(); i++ )
1116 if ( stylesWidget->item( i )->checkState() == Qt::CheckState::Checked )
1118 stylesSelected.push_back( stylesWidget->item( i )->text() );
1122 if ( !stylesSelected.isEmpty() )
1125 for (
const QString &styleName : std::as_const( stylesSelected ) )
1127 bool defaultLoadedFlag =
false;
1129 StyleType type = dlg.currentStyleType();
1137 const QString filePath { dlg.outputFilePath() };
1138 const QFileInfo fi { filePath };
1140 if ( styleIndex > 0 && stylesSelected.count() > 1 )
1143 while ( QFile::exists( safePath ) )
1145 const QFileInfo fi { safePath };
1146 safePath = QString( safePath ).replace(
'.' + fi.completeSuffix(), QStringLiteral(
"_%1.%2" ).arg( QString::number( i ), fi.completeSuffix() ) );
1151 message = mLayer->
saveNamedStyle( safePath, defaultLoadedFlag, dlg.styleCategories() );
1153 message = mLayer->
saveSldStyle( safePath, defaultLoadedFlag );
1156 if ( defaultLoadedFlag )
1163 QMessageBox::information(
this, tr(
"Save Style" ), message );
1170 QString infoWindowTitle = QObject::tr(
"Save style '%1' to DB (%2)" )
1177 QString name { dbSettings.
name };
1178 if ( name.isEmpty() )
1184 name += QStringLiteral(
"_%1" ).arg( styleName );
1185 QStringList ids, names, descriptions;
1188 while ( names.contains( name ) )
1190 name = QStringLiteral(
"%1 %2" ).arg( name, QString::number( i ) );
1195 QString errorMessage;
1198 if ( QMessageBox::question(
nullptr, QObject::tr(
"Save style in database" ), QObject::tr(
"A matching style already exists in the database for this layer. Do you want to overwrite it?" ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
1203 else if ( !errorMessage.isEmpty() )
1205 QMessageBox::warning(
this, infoWindowTitle, errorMessage );
1211 if ( !msgError.isNull() )
1213 QMessageBox::warning(
this, infoWindowTitle, msgError );
1217 QMessageBox::information(
this, infoWindowTitle, tr(
"Style '%1' saved" ).arg( styleName ) );
1232void QgsVectorLayerProperties::aboutToShowStyleMenu()
1235 QMenu *m = qobject_cast<QMenu *>( sender() );
1238 m->addAction( mActionLoadStyle );
1239 m->addAction( mActionSaveStyle );
1244 mActionSaveStyle->setText( tr(
"Save Current Style…" ) );
1245 m->addAction( mActionSaveMultipleStyles );
1249 mActionSaveStyle->setText( tr(
"Save Style…" ) );
1261void QgsVectorLayerProperties::mButtonAddJoin_clicked()
1266 QList<QgsMapLayer *> joinedLayers;
1267 const QList<QgsVectorLayerJoinInfo> &joins = mLayer->
vectorJoins();
1268 joinedLayers.reserve( joins.size() );
1269 for (
int i = 0; i < joins.size(); ++i )
1271 joinedLayers.append( joins[i].joinLayer() );
1275 if ( d.exec() == QDialog::Accepted )
1279 if ( d.createAttributeIndex() )
1288 addJoinToTreeWidget( info );
1289 setPbnQueryBuilderEnabled();
1290 mSourceFieldsPropertiesDialog->
init();
1291 mAttributesFormPropertiesDialog->
init();
1295void QgsVectorLayerProperties::mButtonEditJoin_clicked()
1297 QTreeWidgetItem *currentJoinItem = mJoinTreeWidget->currentItem();
1298 mJoinTreeWidget_itemDoubleClicked( currentJoinItem, 0 );
1301void QgsVectorLayerProperties::mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item,
int )
1303 if ( !mLayer || !item )
1308 QList<QgsMapLayer *> joinedLayers;
1309 QString joinLayerId = item->data( 0, Qt::UserRole ).toString();
1310 const QList<QgsVectorLayerJoinInfo> &joins = mLayer->
vectorJoins();
1312 for (
int i = 0; i < joins.size(); ++i )
1318 if ( joinLayer->
id() == joinLayerId )
1325 joinedLayers.append( joinLayer );
1334 d.setWindowTitle( tr(
"Edit Vector Join" ) );
1335 d.setJoinInfo( joins[j] );
1337 if ( d.exec() == QDialog::Accepted )
1343 int idx = mJoinTreeWidget->indexOfTopLevelItem( item );
1344 mJoinTreeWidget->takeTopLevelItem( idx );
1349 if ( d.createAttributeIndex() )
1358 addJoinToTreeWidget( info, idx );
1360 setPbnQueryBuilderEnabled();
1361 mSourceFieldsPropertiesDialog->
init();
1362 mAttributesFormPropertiesDialog->
init();
1366void QgsVectorLayerProperties::addJoinToTreeWidget(
const QgsVectorLayerJoinInfo &join,
const int insertIndex )
1368 QTreeWidgetItem *joinItem =
new QTreeWidgetItem();
1369 joinItem->setFlags( Qt::ItemIsEnabled );
1372 if ( !mLayer || !joinLayer )
1377 joinItem->setText( 0, tr(
"Join layer" ) );
1383 joinItem->setText( 1, joinLayer->
name() );
1385 QFont f = joinItem->font( 0 );
1387 joinItem->setFont( 0, f );
1388 joinItem->setFont( 1, f );
1390 joinItem->setData( 0, Qt::UserRole, join.
joinLayerId() );
1392 QTreeWidgetItem *childJoinField =
new QTreeWidgetItem();
1393 childJoinField->setText( 0, tr(
"Join field" ) );
1395 childJoinField->setFlags( Qt::ItemIsEnabled );
1396 joinItem->addChild( childJoinField );
1398 QTreeWidgetItem *childTargetField =
new QTreeWidgetItem();
1399 childTargetField->setText( 0, tr(
"Target field" ) );
1401 joinItem->addChild( childTargetField );
1403 QTreeWidgetItem *childMemCache =
new QTreeWidgetItem();
1404 childMemCache->setText( 0, tr(
"Cache join layer in virtual memory" ) );
1406 childMemCache->setText( 1, QChar( 0x2714 ) );
1407 joinItem->addChild( childMemCache );
1409 QTreeWidgetItem *childDynForm =
new QTreeWidgetItem();
1410 childDynForm->setText( 0, tr(
"Dynamic form" ) );
1412 childDynForm->setText( 1, QChar( 0x2714 ) );
1413 joinItem->addChild( childDynForm );
1415 QTreeWidgetItem *childEditable =
new QTreeWidgetItem();
1416 childEditable->setText( 0, tr(
"Editable join layer" ) );
1418 childEditable->setText( 1, QChar( 0x2714 ) );
1419 joinItem->addChild( childEditable );
1421 QTreeWidgetItem *childUpsert =
new QTreeWidgetItem();
1422 childUpsert->setText( 0, tr(
"Upsert on edit" ) );
1424 childUpsert->setText( 1, QChar( 0x2714 ) );
1425 joinItem->addChild( childUpsert );
1427 QTreeWidgetItem *childCascade =
new QTreeWidgetItem();
1428 childCascade->setText( 0, tr(
"Delete cascade" ) );
1430 childCascade->setText( 1, QChar( 0x2714 ) );
1431 joinItem->addChild( childCascade );
1433 QTreeWidgetItem *childPrefix =
new QTreeWidgetItem();
1434 childPrefix->setText( 0, tr(
"Custom field name prefix" ) );
1435 childPrefix->setText( 1, join.
prefix() );
1436 joinItem->addChild( childPrefix );
1438 QTreeWidgetItem *childFields =
new QTreeWidgetItem();
1439 childFields->setText( 0, tr(
"Joined fields" ) );
1442 childFields->setText( 1, QLocale().toString( list->count() ) );
1444 childFields->setText( 1, tr(
"all" ) );
1445 joinItem->addChild( childFields );
1447 if ( insertIndex >= 0 )
1448 mJoinTreeWidget->insertTopLevelItem( insertIndex, joinItem );
1450 mJoinTreeWidget->addTopLevelItem( joinItem );
1452 mJoinTreeWidget->setCurrentItem( joinItem );
1453 mJoinTreeWidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
1463 QDialog *dlg =
new QDialog();
1464 QString key = QStringLiteral(
"/UI/paneldialog/%1" ).arg( panel->
panelTitle() );
1466 dlg->restoreGeometry( settings.
value( key ).toByteArray() );
1468 dlg->setLayout(
new QVBoxLayout() );
1469 dlg->layout()->addWidget( panel );
1470 QDialogButtonBox *buttonBox =
new QDialogButtonBox( QDialogButtonBox::Ok );
1471 connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
1472 dlg->layout()->addWidget( buttonBox );
1474 settings.
setValue( key, dlg->saveGeometry() );
1478void QgsVectorLayerProperties::mButtonRemoveJoin_clicked()
1480 QTreeWidgetItem *currentJoinItem = mJoinTreeWidget->currentItem();
1481 if ( !mLayer || !currentJoinItem )
1486 mLayer->
removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );
1487 mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
1488 setPbnQueryBuilderEnabled();
1489 mSourceFieldsPropertiesDialog->
init();
1490 mAttributesFormPropertiesDialog->
init();
1494void QgsVectorLayerProperties::mButtonAddWmsDimension_clicked()
1500 QStringList alreadyDefinedDimensions;
1502 const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &dims = serverProperties->
wmsDimensions();
1505 alreadyDefinedDimensions << dim.name;
1509 if ( d.exec() == QDialog::Accepted )
1514 addWmsDimensionInfoToTreeWidget( info );
1518void QgsVectorLayerProperties::mButtonEditWmsDimension_clicked()
1520 QTreeWidgetItem *currentWmsDimensionItem = mWmsDimensionsTreeWidget->currentItem();
1521 mWmsDimensionsTreeWidget_itemDoubleClicked( currentWmsDimensionItem, 0 );
1524void QgsVectorLayerProperties::mWmsDimensionsTreeWidget_itemDoubleClicked( QTreeWidgetItem *item,
int )
1526 if ( !mLayer || !item )
1531 QString wmsDimName = item->data( 0, Qt::UserRole ).toString();
1533 const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &dims = serverProperties->
wmsDimensions();
1534 QStringList alreadyDefinedDimensions;
1536 for (
int i = 0; i < dims.size(); ++i )
1538 QString dimName = dims[i].name;
1539 if ( dimName == wmsDimName )
1545 alreadyDefinedDimensions << dimName;
1554 d.setWindowTitle( tr(
"Edit WMS Dimension" ) );
1555 d.setInfo( dims[j] );
1557 if ( d.exec() == QDialog::Accepted )
1564 int idx = mWmsDimensionsTreeWidget->indexOfTopLevelItem( item );
1565 mWmsDimensionsTreeWidget->takeTopLevelItem( idx );
1569 addWmsDimensionInfoToTreeWidget( info, idx );
1575 QTreeWidgetItem *wmsDimensionItem =
new QTreeWidgetItem();
1576 wmsDimensionItem->setFlags( Qt::ItemIsEnabled );
1578 wmsDimensionItem->setText( 0, tr(
"Dimension" ) );
1579 wmsDimensionItem->setText( 1, wmsDim.
name );
1581 QFont f = wmsDimensionItem->font( 0 );
1583 wmsDimensionItem->setFont( 0, f );
1584 wmsDimensionItem->setFont( 1, f );
1586 wmsDimensionItem->setData( 0, Qt::UserRole, wmsDim.
name );
1588 QTreeWidgetItem *childWmsDimensionField =
new QTreeWidgetItem();
1589 childWmsDimensionField->setText( 0, tr(
"Field" ) );
1590 childWmsDimensionField->setText( 1, wmsDim.
fieldName );
1591 childWmsDimensionField->setFlags( Qt::ItemIsEnabled );
1592 wmsDimensionItem->addChild( childWmsDimensionField );
1594 QTreeWidgetItem *childWmsDimensionEndField =
new QTreeWidgetItem();
1595 childWmsDimensionEndField->setText( 0, tr(
"End field" ) );
1596 childWmsDimensionEndField->setText( 1, wmsDim.
endFieldName );
1597 childWmsDimensionEndField->setFlags( Qt::ItemIsEnabled );
1598 wmsDimensionItem->addChild( childWmsDimensionEndField );
1600 QTreeWidgetItem *childWmsDimensionUnits =
new QTreeWidgetItem();
1601 childWmsDimensionUnits->setText( 0, tr(
"Units" ) );
1602 childWmsDimensionUnits->setText( 1, wmsDim.
units );
1603 childWmsDimensionUnits->setFlags( Qt::ItemIsEnabled );
1604 wmsDimensionItem->addChild( childWmsDimensionUnits );
1606 QTreeWidgetItem *childWmsDimensionUnitSymbol =
new QTreeWidgetItem();
1607 childWmsDimensionUnitSymbol->setText( 0, tr(
"Unit symbol" ) );
1608 childWmsDimensionUnitSymbol->setText( 1, wmsDim.
unitSymbol );
1609 childWmsDimensionUnitSymbol->setFlags( Qt::ItemIsEnabled );
1610 wmsDimensionItem->addChild( childWmsDimensionUnitSymbol );
1612 QTreeWidgetItem *childWmsDimensionDefaultValue =
new QTreeWidgetItem();
1613 childWmsDimensionDefaultValue->setText( 0, tr(
"Default display" ) );
1615 childWmsDimensionDefaultValue->setFlags( Qt::ItemIsEnabled );
1616 wmsDimensionItem->addChild( childWmsDimensionDefaultValue );
1618 QTreeWidgetItem *childWmsDimensionRefValue =
new QTreeWidgetItem();
1619 childWmsDimensionRefValue->setText( 0, tr(
"Reference value" ) );
1620 childWmsDimensionRefValue->setText( 1, wmsDim.
referenceValue.toString() );
1621 childWmsDimensionRefValue->setFlags( Qt::ItemIsEnabled );
1622 wmsDimensionItem->addChild( childWmsDimensionRefValue );
1624 if ( insertIndex >= 0 )
1625 mWmsDimensionsTreeWidget->insertTopLevelItem( insertIndex, wmsDimensionItem );
1627 mWmsDimensionsTreeWidget->addTopLevelItem( wmsDimensionItem );
1629 mWmsDimensionsTreeWidget->setCurrentItem( wmsDimensionItem );
1630 mWmsDimensionsTreeWidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
1633void QgsVectorLayerProperties::mButtonRemoveWmsDimension_clicked()
1635 QTreeWidgetItem *currentWmsDimensionItem = mWmsDimensionsTreeWidget->currentItem();
1636 if ( !mLayer || !currentWmsDimensionItem )
1642 serverProperties->
removeWmsDimension( currentWmsDimensionItem->data( 0, Qt::UserRole ).toString() );
1643 mWmsDimensionsTreeWidget->takeTopLevelItem( mWmsDimensionsTreeWidget->indexOfTopLevelItem( currentWmsDimensionItem ) );
1647void QgsVectorLayerProperties::updateSymbologyPage()
1650 delete mRendererDialog;
1651 mRendererDialog =
nullptr;
1667 mOptsPage_Style->setEnabled(
false );
1670 if ( mRendererDialog )
1672 mRendererDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
1673 widgetStackRenderers->addWidget( mRendererDialog );
1674 widgetStackRenderers->setCurrentWidget( mRendererDialog );
1675 widgetStackRenderers->currentWidget()->layout()->setContentsMargins( 0, 0, 0, 0 );
1679void QgsVectorLayerProperties::setPbnQueryBuilderEnabled()
1685 pbnQueryBuilder->setToolTip( tr(
"Stop editing mode to enable this." ) );
1689void QgsVectorLayerProperties::pbnUpdateExtents_clicked()
1692 mMetadataFilled =
false;
1699 if ( index ==
mOptStackedWidget->indexOf( mOptsPage_Information ) && !mMetadataFilled )
1702 teMetadataViewer->clear();
1703 teMetadataViewer->setHtml( htmlMetadata() );
1704 mMetadataFilled =
true;
1709 mAttributesFormPropertiesDialog->
store();
1715void QgsVectorLayerProperties::mSimplifyDrawingGroupBox_toggled(
bool checked )
1720 mSimplifyDrawingAtProvider->setEnabled(
false );
1724 mSimplifyDrawingAtProvider->setEnabled( checked );
1728void QgsVectorLayerProperties::updateVariableEditor()
1731 mVariableEditor->setContext( &context );
1735 mVariableEditor->reloadContext();
1736 mVariableEditor->setEditableScopeIndex( 2 );
1739void QgsVectorLayerProperties::showHelp()
1741 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property(
"helpPage" );
1743 if ( helpPage.isValid() )
1749 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/vector_properties.html" ) );
1753void QgsVectorLayerProperties::updateAuxiliaryStoragePage()
1760 mAuxiliaryStorageInformationGrpBox->setEnabled(
true );
1761 mAuxiliaryStorageFieldsGrpBox->setEnabled(
true );
1768 mAuxiliaryStorageFeaturesLineEdit->setText( QLocale().toString( features ) );
1771 mAuxiliaryLayerActionClear->setEnabled(
true );
1772 mAuxiliaryLayerActionDelete->setEnabled(
true );
1773 mAuxiliaryLayerActionExport->setEnabled(
true );
1774 mAuxiliaryLayerActionNew->setEnabled(
false );
1780 mAuxiliaryStorageFieldsLineEdit->setText( QLocale().toString( fields ) );
1783 mAuxiliaryStorageFieldsTree->clear();
1784 for (
const QgsField &field : alayer->auxiliaryFields() )
1787 QTreeWidgetItem *item =
new QTreeWidgetItem();
1789 item->setText( 0, prop.
origin() );
1790 item->setText( 1, prop.
name() );
1791 item->setText( 2, prop.
comment() );
1792 item->setText( 3, field.typeName() );
1793 item->setText( 4, field.name() );
1795 mAuxiliaryStorageFieldsTree->addTopLevelItem( item );
1801 mAuxiliaryStorageInformationGrpBox->setEnabled(
false );
1802 mAuxiliaryStorageFieldsGrpBox->setEnabled(
false );
1804 mAuxiliaryLayerActionClear->setEnabled(
false );
1805 mAuxiliaryLayerActionDelete->setEnabled(
false );
1806 mAuxiliaryLayerActionExport->setEnabled(
false );
1807 mAuxiliaryLayerActionNew->setEnabled(
true );
1809 mAuxiliaryStorageFieldsTree->clear();
1810 mAuxiliaryStorageKeyLineEdit->setText( QString() );
1811 mAuxiliaryStorageFieldsLineEdit->setText( QString() );
1812 mAuxiliaryStorageFeaturesLineEdit->setText( QString() );
1816void QgsVectorLayerProperties::onAuxiliaryLayerNew()
1824 if ( dlg.exec() == QDialog::Accepted )
1826 updateAuxiliaryStoragePage();
1830void QgsVectorLayerProperties::onAuxiliaryLayerClear()
1837 const QString msg = tr(
"Are you sure you want to clear auxiliary data for %1?" ).arg( mLayer->
name() );
1838 QMessageBox::StandardButton reply;
1839 reply = QMessageBox::question(
this,
"Clear Auxiliary Data", msg, QMessageBox::Yes | QMessageBox::No );
1841 if ( reply == QMessageBox::Yes )
1843 QApplication::setOverrideCursor( Qt::WaitCursor );
1845 QApplication::restoreOverrideCursor();
1846 updateAuxiliaryStoragePage();
1851void QgsVectorLayerProperties::onAuxiliaryLayerDelete()
1857 const QString msg = tr(
"Are you sure you want to delete auxiliary storage for %1?" ).arg( mLayer->
name() );
1858 QMessageBox::StandardButton reply;
1859 reply = QMessageBox::question(
this,
"Delete Auxiliary Storage", msg, QMessageBox::Yes | QMessageBox::No );
1861 if ( reply == QMessageBox::Yes )
1863 QApplication::setOverrideCursor( Qt::WaitCursor );
1876 QApplication::restoreOverrideCursor();
1877 updateAuxiliaryStoragePage();
1882void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
1888 QList<QTreeWidgetItem *> items = mAuxiliaryStorageFieldsTree->selectedItems();
1889 if ( items.count() < 1 )
1893 const QTreeWidgetItem *item = items[0];
1896 def.
setName( item->text( 1 ) );
1906 const QString msg = tr(
"Are you sure you want to delete auxiliary field %1 for %2?" ).arg( item->text( 1 ), item->text( 0 ) );
1908 QMessageBox::StandardButton reply;
1909 const QString title = QObject::tr(
"Delete Auxiliary Field" );
1910 reply = QMessageBox::question(
this, title, msg, QMessageBox::Yes | QMessageBox::No );
1912 if ( reply == QMessageBox::Yes )
1914 QApplication::setOverrideCursor( Qt::WaitCursor );
1915 deleteAuxiliaryField( index );
1917 QApplication::restoreOverrideCursor();
1921void QgsVectorLayerProperties::onAuxiliaryLayerAddField()
1928 if ( dlg.exec() == QDialog::Accepted )
1930 updateAuxiliaryStoragePage();
1934void QgsVectorLayerProperties::deleteAuxiliaryField(
int index )
1947 if ( key >= 0 && def.
origin().compare(
"labeling", Qt::CaseInsensitive ) == 0
1954 updateAuxiliaryStoragePage();
1955 mSourceFieldsPropertiesDialog->
init();
1959 const QString title = QObject::tr(
"Delete Auxiliary Field" );
1961 const QString msg = QObject::tr(
"Unable to remove auxiliary field (%1)" ).arg( errors );
1969 if ( obj == mMapTipPreviewContainer && ev->type() == QEvent::Resize )
1973 return QgsOptionsDialogBase::eventFilter( obj, ev );
1976void QgsVectorLayerProperties::initMapTipPreview()
1979 mMapTipSplitter->setSizes( { 400, 200 } );
1981 mMapTipPreviewContainer->installEventFilter(
this );
1985 mMapTipPreview =
new QgsWebView( mMapTipPreviewContainer );
1988 mMapTipPreview->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
1989 mMapTipPreview->setContextMenuPolicy( Qt::NoContextMenu );
1990 connect( mMapTipPreview, &QWebView::loadFinished,
this, &QgsVectorLayerProperties::resizeMapTip );
1993 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled,
true );
1994 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled,
true );
1995 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::LocalStorageEnabled,
true );
1998 mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
1999 mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
2002 connect( mMapTipWidget, &QgsCodeEditorHTML::textChanged,
this, &QgsVectorLayerProperties::updateMapTipPreview );
2006void QgsVectorLayerProperties::updateMapTipPreview()
2008 mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
2010 mMapTipPreview->setHtml( htmlContent );
2013void QgsVectorLayerProperties::resizeMapTip()
2016 mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
2019 const QWebElement container = mMapTipPreview->page()->mainFrame()->findFirstElement(
2020 QStringLiteral(
"#QgsWebViewContainer" )
2022 const int width = container.geometry().width();
2023 const int height = container.geometry().height();
2024 mMapTipPreview->resize( width, height );
2027 mMapTipPreview->move( ( mMapTipPreviewContainer->width() - mMapTipPreview->width() ) / 2, ( mMapTipPreviewContainer->height() - mMapTipPreview->height() ) / 2 );
2030 mMapTipPreview->adjustSize();
@ SimplifyGeometries
Supports simplification of geometries on provider side according to a distance tolerance.
@ SelectEncoding
Allows user to select encoding.
@ CreateSpatialIndex
Allows creation of spatial index.
QFlags< VectorRenderingSimplificationFlag > VectorRenderingSimplificationFlags
Simplification flags for vector feature rendering.
@ Present
A valid spatial index exists for the source.
@ AntialiasingSimplification
The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'.
@ NoSimplification
No simplification can be applied.
@ GeometrySimplification
The geometries can be simplified using the current map2pixel context state.
VectorSimplificationAlgorithm
Simplification algorithms for vector features.
@ Distance
The simplification uses the distance between points to remove duplicate points.
@ SnapToGrid
The simplification uses a grid (similar to ST_SnapToGrid) to remove duplicate points.
@ Visvalingam
The simplification gives each point in a line an importance weighting, so that least important points...
@ Warning
Warning message.
static QString defaultProjectScales()
A string with default project scales.
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
QFlags< VectorProviderCapability > VectorProviderCapabilities
Vector data provider capabilities.
@ CustomColor
Use default symbol with a custom selection color.
@ CustomSymbol
Use a custom symbol.
@ Default
Use default symbol and selection colors.
void clearActions()
Removes all actions.
QUuid addAction(Qgis::AttributeActionType type, const QString &name, const QString &command, bool capture=false)
Add an action with the given name and action details.
Utility class that encapsulates an action based on vector attributes.
static QString reportStyleSheet(QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt)
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet...
static QRegularExpression shortNameRegularExpression()
Returns the short name regular expression for line edit validator.
void init(const QgsActionManager &action, const QgsAttributeTableConfig &attributeTableConfig)
bool showWidgetInAttributeTable() const
QList< QgsAction > actions() const
QgsAttributeTableConfig::ActionWidgetStyle attributeTableWidgetStyle() const
This is a container for configuration of the attribute table.
@ Action
This column represents an action widget.
QVector< QgsAttributeTableConfig::ColumnConfig > columns() const
Gets the list with all columns and their configuration.
void update(const QgsFields &fields)
Update the configuration with the given fields.
void setActionWidgetStyle(ActionWidgetStyle actionWidgetStyle)
Set the style of the action widget.
void setColumns(const QVector< QgsAttributeTableConfig::ColumnConfig > &columns)
Set the list of columns visible in the attribute table.
Class allowing to manage the auxiliary storage for a vector layer.
static QString nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
static QgsPropertyDefinition propertyDefinitionFromField(const QgsField &field)
Returns the property definition from an auxiliary field.
bool clear()
Deletes all features from the layer.
bool deleteAttribute(int attr) override
Removes attribute from the layer and commits changes.
QgsFields auxiliaryFields() const
Returns a list of all auxiliary fields currently managed by the layer.
int propertyFromIndex(int index) const
Returns the underlying property key for the field index.
QgsVectorLayerJoinInfo joinInfo() const
Returns information to use for joining with primary key and so on.
QgsPropertyDefinition propertyDefinitionFromIndex(int index) const
Returns the property definition for the underlying field index.
static bool deleteTable(const QgsDataSourceUri &uri)
Removes a table from the auxiliary storage.
This class represents a coordinate reference system (CRS).
virtual bool supportsSubsetString() const
Returns true if the provider supports setting of subset strings.
Class for storing the component parts of a RDBMS data source URI (e.g.
A generic dialog for building expression strings.
static void setLayerVariables(QgsMapLayer *layer, const QVariantMap &variables)
Sets all layer context variables.
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
static QgsExpressionContextScope * atlasScope(const QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static QString findAndSelectActiveExpression(QgsCodeEditor *editor, const QString &pattern=QString())
Find the expression under the cursor in the given editor and select it.
bool forceRasterRender() const
Returns whether the renderer must render as a raster.
void setForceRasterRender(bool forceRaster)
Sets whether the renderer should be rendered to a raster destination.
double referenceScale() const
Returns the symbology reference scale.
void setReferenceScale(double scale)
Sets the symbology reference scale.
virtual Qgis::SpatialIndexPresence hasSpatialIndex() const
Returns an enum value representing the presence of a valid spatial index on the source,...
Encapsulate a field in an attribute table or data source.
Q_INVOKABLE int indexFromName(const QString &fieldName) const
Gets the field index from the field name.
Q_INVOKABLE int indexOf(const QString &fieldName) const
Gets the field index from the field name.
int size() const
Returns number of items.
static QString stringToSafeFilename(const QString &string)
Converts a string to a safe filename, replacing characters which are not safe for filenames with an '...
static QgsProviderSourceWidgetProviderRegistry * sourceWidgetProviderRegistry()
Returns the registry of provider source widget providers.
static QgsSubsetStringEditorProviderRegistry * subsetStringEditorProviderRegistry()
Returns the registry of subset string editors of data providers.
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Base class for "layer properties" dialogs, containing common utilities for handling functionality in ...
QPushButton * mBtnStyle
Style button.
void saveMetadataToFile()
Allows the user to save the layer's metadata as a file.
virtual void rollback()
Rolls back changes made to the layer.
void optionsStackedWidget_CurrentChanged(int index) override
StyleType
Style storage type.
QList< QgsMapLayerConfigWidget * > mConfigWidgets
Layer config widgets.
void setMetadataWidget(QgsMetadataWidget *widget, QWidget *page)
Sets the metadata widget and page associated with the dialog.
void loadDefaultStyle()
Reloads the default style for the layer.
void saveStyleAs()
Saves a style when appriate button is pressed.
void loadStyle()
Triggers a dialog to load a saved style.
QgsMapCanvas * mCanvas
Associated map canvas.
void loadDefaultMetadata()
Reloads the default layer metadata for the layer.
void loadMetadataFromFile()
Allows the user to load layer metadata from a file.
void saveDefaultStyle()
Saves the default style when appropriate button is pressed.
QPushButton * mBtnMetadata
Metadata button.
void initialize()
Initialize the dialog.
void saveMetadataAsDefault()
Saves the current layer metadata as the default for the layer.
void openUrl(const QUrl &url)
Handles opening a url from the dialog.
QgsLayerTreeFilterProxyModel is a sort filter proxy model to easily reproduce the legend/layer tree i...
QList< QgsMapLayer * > checkedLayers() const
Returns the checked layers.
void setLayerTreeModel(QgsLayerTreeModel *layerTreeModel)
Sets the layer tree model.
void setCheckedLayers(const QList< QgsMapLayer * > layers)
Initialize the list of checked layers.
The QgsLayerTreeModel class is model implementation for Qt item views framework.
Map canvas is a class for displaying all GIS data types on a canvas.
QColor selectionColor() const
Returns color for selected features.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
double scale() const
Returns the last reported scale of the canvas.
This class models dependencies with or between map layers.
The QgsMapLayerSaveStyleDialog class provides the UI to save the current style or multiple styles int...
Manages QGIS Server properties for a map layer.
void setDataUrl(const QString &dataUrl)
Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
void setAbstract(const QString &abstract)
Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
void setDataUrlFormat(const QString &dataUrlFormat)
Sets the DataUrl format of the layerused by QGIS Server in GetCapabilities request.
QString attribution() const
Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
void setAttributionUrl(const QString &url)
Sets the attribution url of the layer used by QGIS Server in GetCapabilities request.
QString dataUrlFormat() const
Returns the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
void setAttribution(const QString &attrib)
Sets the attribution of the layer used by QGIS Server in GetCapabilities request.
void setShortName(const QString &name)
Sets the short name of the layer used by QGIS Server to identify the layer.
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
QString dataUrl() const
Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
QString keywordList() const
Returns the keyword list of the layerused by QGIS Server in GetCapabilities request.
QString wfsTitle() const
Returns the optional WFS title if set or the title of the layer used by QGIS WFS in GetCapabilities r...
QString shortName() const
Returns the short name of the layer used by QGIS Server to identify the layer.
void setTitle(const QString &title)
Sets the title of the layer used by QGIS Server in GetCapabilities request.
void setKeywordList(const QString &keywords)
Sets the keywords list of the layerused by QGIS Server in GetCapabilities request.
QString attributionUrl() const
Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
void setWfsTitle(const QString &title)
Sets the title of the layer used by QGIS Server in WFS GetCapabilities request.
QString abstract() const
Returns the abstract of the layerused by QGIS Server in GetCapabilities request.
void addStyleManagerActions(QMenu *m, QgsMapLayer *layer)
adds actions to the menu in accordance to the layer
static QgsMapLayerStyleGuiUtils * instance()
returns a singleton instance of this class
QString currentStyle() const
Returns name of the current style.
QStringList styles() const
Returns list of all defined style names.
bool setCurrentStyle(const QString &name)
Set a different style as the current style - will apply it to the layer.
void currentStyleChanged(const QString ¤tName)
Emitted when the current style has been changed.
Base class for all map layer types.
QString legendUrlFormat() const
Returns the format for a URL based layer legend.
void setRefreshOnNotifyEnabled(bool enabled)
Set whether provider notification is connected to triggerRepaint.
virtual QString saveSldStyle(const QString &uri, bool &resultFlag) const
Saves the properties of this layer to an SLD format file.
QString source() const
Returns the source for the layer.
void setLegendUrl(const QString &legendUrl)
Sets the URL for the layer's legend.
QString providerType() const
Returns the provider type (provider key) for this layer.
void setMinimumScale(double scale)
Sets the minimum map scale (i.e.
QgsCoordinateReferenceSystem crs
QgsMapLayerServerProperties * serverProperties()
Returns QGIS Server Properties for the map layer.
virtual int listStylesInDatabase(QStringList &ids, QStringList &names, QStringList &descriptions, QString &msgError)
Lists all the style in db split into related to the layer and not related to.
void setDataSource(const QString &dataSource, const QString &baseName=QString(), const QString &provider=QString(), bool loadDefaultStyleFlag=false)
Updates the data source of the layer.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
void setMaximumScale(double scale)
Sets the maximum map scale (i.e.
QgsLayerMetadata metadata
bool isRefreshOnNotifyEnabled() const
Returns true if the refresh on provider nofification is enabled.
virtual void saveStyleToDatabase(const QString &name, const QString &description, bool useAsDefault, const QString &uiFileContent, QString &msgError, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories)
Saves named and sld style of the layer to the style table in the db.
void setScaleBasedVisibility(bool enabled)
Sets whether scale based visibility is enabled for the layer.
bool hasScaleBasedVisibility() const
Returns whether scale based visibility is enabled for the layer.
void setRefreshOnNofifyMessage(const QString &message)
Set the notification message that triggers repaint If refresh on notification is enabled,...
void setName(const QString &name)
Set the display name of the layer.
QString refreshOnNotifyMessage() const
Returns the message that should be notified by the provider to triggerRepaint.
void setMapTipsEnabled(bool enabled)
Enable or disable map tips for this layer.
double minimumScale() const
Returns the minimum map scale (i.e.
QgsMapLayerStyleManager * styleManager() const
Gets access to the layer's style manager.
QString legendUrl() const
Returns the URL for the layer's legend.
void setLegendUrlFormat(const QString &legendUrlFormat)
Sets the format for a URL based layer legend.
virtual QString saveNamedStyle(const QString &uri, bool &resultFlag, StyleCategories categories=AllStyleCategories)
Save the properties of this layer as a named style (either as a .qml file on disk or as a record in t...
void setMapTipTemplate(const QString &mapTipTemplate)
The mapTip is a pretty, html representation for feature information.
double maximumScale() const
Returns the maximum map scale (i.e.
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
The QgsMapSettings class contains configuration for rendering of the map.
static QString vectorMapTipPreviewText(QgsMapLayer *layer, QgsMapCanvas *mapCanvas, const QString &mapTemplate, const QString &displayExpression)
Returns the html that would be displayed in a maptip for a given layer.
A bar for displaying non-blocking messages to the user.
void pushMessage(const QString &text, Qgis::MessageLevel level=Qgis::MessageLevel::Info, int duration=-1)
A convenience method for pushing a message with the specified text to the bar.
A dialog to create a new auxiliary field.
A dialog to create a new auxiliary layer.
void resizeAlltabs(int index)
Resizes all tabs when the dialog is resized.
QStackedWidget * mOptStackedWidget
void initOptionsBase(bool restoreUi=true, const QString &title=QString())
Set up the base ui connections for vertical tabs.
Property
Data definable properties.
static QgsProject * instance()
Returns the QgsProject singleton instance.
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
void setDirty(bool b=true)
Flag the project as dirty (modified).
Definition for a property.
QString comment() const
Returns the comment of the property.
void setOrigin(const QString &origin)
Sets the origin of the property.
QString name() const
Returns the name of the property.
void setName(const QString &name)
Sets the name of the property.
QString origin() const
Returns the origin of the property.
void setComment(const QString &comment)
Sets comment of the property.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
void showPanel(QgsPanelWidget *panel)
Emit when you require a panel to be show in the interface.
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the dialog is shown, e.g., the associated map canvas and expression context...
void apply()
Apply the changes from the dialog to the layer.
void layerVariablesChanged()
Emitted when expression context variables on the associated vector layers have been changed.
void widgetChanged()
Emitted when something on the widget has changed.
void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
static QMap< int, QString > wmsDimensionDefaultDisplayLabels()
Returns WMS Dimension default display labels.
bool addWmsDimension(const QgsServerWmsDimensionProperties::WmsDimensionInfo &wmsDimInfo)
Adds a QGIS Server WMS Dimension.
bool removeWmsDimension(const QString &wmsDimName)
Removes a QGIS Server WMS Dimension.
const QList< QgsServerWmsDimensionProperties::WmsDimensionInfo > wmsDimensions() const
Returns the QGIS Server WMS Dimension list.
This class is a composition of two QSettings instances:
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
static QgsStyle * defaultStyle(bool initialize=true)
Returns the default application-wide style.
Interface for a dialog that can edit subset strings.
virtual QString subsetString() const =0
Returns the subset string entered in the dialog.
virtual void setSubsetString(const QString &subsetString)=0
Sets a subset string into the dialog.
QgsSubsetStringEditorInterface * createDialog(QgsVectorLayer *layer, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Creates a new dialog to edit the subset string of the provided layer.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
Abstract base class for all rendered symbols.
This is the base class for vector data providers.
static QStringList availableEncodings()
Returns a list of available encodings.
virtual bool createSpatialIndex()
Creates a spatial index on the datasource (if supported by the provider type).
virtual Q_INVOKABLE Qgis::VectorProviderCapabilities capabilities() const
Returns flags containing the supported capabilities.
virtual bool createAttributeIndex(int field)
Create an attribute index on the datasource.
QString encoding() const
Returns the encoding which is used for accessing data.
Defines left outer join from our vector layer to some other vector layer.
bool hasCascadedDelete() const
Returns whether a feature deleted on the target layer has to impact the joined layer by deleting the ...
bool isDynamicFormEnabled() const
Returns whether the form has to be dynamically updated with joined fields when a feature is being cre...
bool hasUpsertOnEdit() const
Returns whether a feature created on the target layer has to impact the joined layer by creating a ne...
bool isEditable() const
Returns whether joined fields may be edited through the form of the target layer.
bool isUsingMemoryCache() const
Returns whether values from the joined layer should be cached in memory to speed up lookups.
QString prefix() const
Returns prefix of fields from the joined layer. If nullptr, joined layer's name will be used.
static QStringList joinFieldNamesSubset(const QgsVectorLayerJoinInfo &info, bool blocklisted=true)
Returns the list of field names to use for joining considering blocklisted fields and subset.
QString joinFieldName() const
Returns name of the field of joined layer that will be used for join.
QString targetFieldName() const
Returns name of the field of our layer that will be used for join.
QString joinLayerId() const
ID of the joined layer - may be used to resolve reference to the joined layer.
QgsVectorLayer * joinLayer() const
Returns joined layer (may be nullptr if the reference was set by layer ID and not resolved yet)
bool eventFilter(QObject *obj, QEvent *ev) override
QgsVectorLayerProperties(QgsMapCanvas *canvas, QgsMessageBar *messageBar, QgsVectorLayer *lyr=nullptr, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
void optionsStackedWidget_CurrentChanged(int index) final
void toggleEditing(QgsMapLayer *)
void exportAuxiliaryLayer(QgsAuxiliaryLayer *layer)
Implementation of layer selection properties for vector layers.
void setSelectionSymbol(QgsSymbol *symbol)
Sets the symbol used to render selected features in the layer.
QgsSymbol * selectionSymbol() const
Returns the symbol used to render selected features in the layer.
Qgis::SelectionRenderingMode selectionRenderingMode() const
Returns the selection rendering mode to use for selected features in the layer.
QColor selectionColor() const
Returns the color to use for rendering selected features in the layer.
void setSelectionColor(const QColor &color)
Sets the color to use for rendering selected features in the layer.
void setSelectionRenderingMode(Qgis::SelectionRenderingMode mode)
Sets the selection rendering mode to use for selected features in the layer.
Represents a vector layer which manages a vector based data sets.
void setAuxiliaryLayer(QgsAuxiliaryLayer *layer=nullptr)
Sets the current auxiliary layer.
bool addJoin(const QgsVectorLayerJoinInfo &joinInfo)
Joins another vector layer to this layer.
QSet< QgsMapLayerDependency > dependencies() const FINAL
Gets the list of dependencies.
long long featureCount(const QString &legendKey) const
Number of features rendered with specified legend key.
void updateFields()
Will regenerate the fields property of this layer by obtaining all fields from the dataProvider,...
bool isSpatial() const FINAL
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
QString htmlMetadata() const FINAL
Obtain a formatted HTML string containing assorted metadata for this layer.
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification settings for fast rendering of features.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
bool setDependencies(const QSet< QgsMapLayerDependency > &layers) FINAL
Sets the list of dependencies.
void setProviderEncoding(const QString &encoding)
Sets the text encoding of the data provider.
void setDisplayExpression(const QString &displayExpression)
Set the preview expression, used to create a human readable preview string.
bool removeJoin(const QString &joinLayerId)
Removes a vector layer join.
bool isEditable() const FINAL
Returns true if the provider is in editing mode.
QStringList commitErrors() const
Returns a list containing any error messages generated when attempting to commit changes to the layer...
virtual void updateExtents(bool force=false)
Update the extents for the layer.
QgsFeatureRenderer * renderer()
Returns the feature renderer used for rendering the features in the layer in 2D map views.
QString displayExpression
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
QgsAttributeTableConfig attributeTableConfig() const
Returns the attribute table configuration object.
QgsActionManager * actions()
Returns all layer actions defined on this layer.
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.
void setAttributeTableConfig(const QgsAttributeTableConfig &attributeTableConfig)
Sets the attribute table configuration object.
virtual bool setSubsetString(const QString &subset)
Sets the string (typically sql) used to define a subset of the layer.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
const QList< QgsVectorLayerJoinInfo > vectorJoins() const
QgsMapLayerSelectionProperties * selectionProperties() override
Returns the layer's selection properties.
This class contains information how to simplify geometries fetched from a vector layer.
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported,...
Qgis::VectorRenderingSimplificationFlags simplifyHints() const
Gets the simplification hints of the vector layer managed.
float maximumScale() const
Gets the maximum scale at which the layer should be simplified.
Qgis::VectorSimplificationAlgorithm simplifyAlgorithm() const
Gets the local simplification algorithm of the vector layer managed.
void setThreshold(float threshold)
Sets the simplification threshold of the vector layer managed.
void setForceLocalOptimization(bool localOptimization)
Sets where the simplification executes, after fetch the geometries from provider, or when supported,...
void setSimplifyHints(Qgis::VectorRenderingSimplificationFlags simplifyHints)
Sets the simplification hints of the vector layer managed.
float threshold() const
Gets the simplification threshold of the vector layer managed.
void setMaximumScale(float maximumScale)
Sets the maximum scale at which the layer should be simplified.
void setSimplifyAlgorithm(Qgis::VectorSimplificationAlgorithm simplifyAlgorithm)
Sets the local simplification algorithm of the vector layer managed.
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
The QgsWmsDimensionDialog class provides an interface for WMS/OAPIF (WFS3) dimensions configuration A...
const QgsCoordinateReferenceSystem & crs
Setting options for creating vector data providers.
Setting to define QGIS Server WMS Dimension.