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 );
160 mMapTipFieldComboBox->setLayer( lyr );
161 mDisplayExpressionWidget->setLayer( lyr );
162 mDisplayExpressionWidget->registerExpressionContextGenerator(
this );
165 connect( mMapTipInsertFieldButton, &QAbstractButton::clicked,
this, &QgsVectorLayerProperties::insertField );
166 connect( mMapTipInsertExpressionButton, &QAbstractButton::clicked,
this, &QgsVectorLayerProperties::insertOrEditExpression );
171 connect( mEnableMapTips, &QAbstractButton::toggled, mHtmlMapTipGroupBox, &QWidget::setEnabled );
174 QVBoxLayout *layout =
nullptr;
179 layout =
new QVBoxLayout( labelingFrame );
180 layout->setContentsMargins( 0, 0, 0, 0 );
182 labelingDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
184 layout->addWidget( labelingDialog );
185 labelingFrame->setLayout( layout );
188 layout =
new QVBoxLayout( mMaskingFrame );
189 layout->setContentsMargins( 0, 0, 0, 0 );
190 mMaskingWidget =
new QgsMaskingWidget( mMaskingFrame );
191 mMaskingWidget->setLayer( mLayer );
192 mMaskingWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
193 layout->addWidget( mMaskingWidget );
194 mMaskingFrame->setLayout( layout );
198 labelingDialog =
nullptr;
199 mOptsPage_Labels->setEnabled(
false );
200 mOptsPage_Masks->setEnabled(
false );
201 mGeomGroupBox->setEnabled(
false );
202 mGeomGroupBox->setVisible(
false );
203 mCrsGroupBox->setEnabled(
false );
204 mCrsGroupBox->setVisible(
false );
208 QVBoxLayout *actionLayout =
new QVBoxLayout( actionOptionsFrame );
209 actionLayout->setContentsMargins( 0, 0, 0, 0 );
211 mActionDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
212 actionLayout->addWidget( mActionDialog );
215 mSourceFieldsPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
216 mSourceFieldsFrame->setLayout(
new QVBoxLayout( mSourceFieldsFrame ) );
217 mSourceFieldsFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
218 mSourceFieldsFrame->layout()->addWidget( mSourceFieldsPropertiesDialog );
223 mAttributesFormPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
224 mAttributesFormFrame->setLayout(
new QVBoxLayout( mAttributesFormFrame ) );
225 mAttributesFormFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
226 mAttributesFormFrame->layout()->addWidget( mAttributesFormPropertiesDialog );
229 QVBoxLayout *metadataLayout =
new QVBoxLayout( metadataFrame );
230 metadataLayout->setContentsMargins( 0, 0, 0, 0 );
232 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
234 metadataLayout->addWidget( mMetadataWidget );
235 metadataFrame->setLayout( metadataLayout );
237 QVBoxLayout *temporalLayout =
new QVBoxLayout( temporalFrame );
238 temporalLayout->setContentsMargins( 0, 0, 0, 0 );
240 temporalLayout->addWidget( mTemporalWidget );
244 mBtnMetadata =
new QPushButton( tr(
"Metadata" ),
this );
245 QMenu *menuMetadata =
new QMenu(
this );
248 menuMetadata->addSeparator();
252 buttonBox->addButton(
mBtnMetadata, QDialogButtonBox::ResetRole );
254 mSelectionColorButton->setAllowOpacity(
true );
255 mSelectionColorButton->setColorDialogTitle( tr(
"Override Selection Color" ) );
261 connect( mRadioOverrideSelectionColor, &QRadioButton::toggled, mSelectionColorButton, &QWidget::setEnabled );
262 mSelectionColorButton->setEnabled(
false );
263 connect( mRadioOverrideSelectionSymbol, &QRadioButton::toggled, mSelectionSymbolButton, &QWidget::setEnabled );
281 mSelectionSymbolButton->setEnabled(
false );
282 mRadioDefaultSelectionColor->setChecked(
true );
292 pbnIndex->setEnabled(
false );
296 pbnIndex->setEnabled(
false );
297 pbnIndex->setText( tr(
"Spatial Index Exists" ) );
304 int encindex = cboProviderEncoding->findText( enc );
307 cboProviderEncoding->insertItem( 0, enc );
310 cboProviderEncoding->setCurrentIndex( encindex );
312 else if ( mLayer->
providerType() == QLatin1String(
"ogr" ) )
317 cboProviderEncoding->setEnabled(
false );
322 mDataSourceEncodingFrame->hide();
326 mCrsSelector->setCrs( mLayer->
crs() );
329 const QList< QgsVectorLayerJoinInfo > &joins = mLayer->
vectorJoins();
332 addJoinToTreeWidget( join );
337 QVBoxLayout *diagLayout =
new QVBoxLayout( mDiagramFrame );
338 diagLayout->setContentsMargins( 0, 0, 0, 0 );
340 diagramPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
342 diagLayout->addWidget( diagramPropertiesDialog );
343 mDiagramFrame->setLayout( diagLayout );
346 mLegendWidget->setMapCanvas(
mCanvas );
347 mLegendWidget->setLayer( mLayer );
348 mLegendConfigEmbeddedWidget->setLayer( mLayer );
351 mLayerShortNameLineEdit->setText( mLayer->
shortName() );
354 mLayerShortNameLineEdit->setValidator( shortNameValidator );
357 mLayerTitleLineEdit->setText( mLayer->
title() );
358 mLayerAbstractTextEdit->setPlainText( mLayer->
abstract() );
359 mLayerKeywordListLineEdit->setText( mLayer->
keywordList() );
360 mLayerDataUrlLineEdit->setText( mLayer->
dataUrl() );
361 mLayerDataUrlFormatComboBox->setCurrentIndex(
362 mLayerDataUrlFormatComboBox->findText(
367 mLayerAttributionLineEdit->setText( mLayer->
attribution() );
368 mLayerAttributionUrlLineEdit->setText( mLayer->
attributionUrl() );
371 tableViewMetadataUrl->setSelectionMode( QAbstractItemView::SingleSelection );
372 tableViewMetadataUrl->setSelectionBehavior( QAbstractItemView::SelectRows );
373 tableViewMetadataUrl->horizontalHeader()->setStretchLastSection(
true );
374 tableViewMetadataUrl->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
376 mMetadataUrlModel =
new QStandardItemModel( tableViewMetadataUrl );
377 mMetadataUrlModel->clear();
378 mMetadataUrlModel->setColumnCount( 3 );
379 QStringList metadataUrlHeaders;
380 metadataUrlHeaders << tr(
"URL" ) << tr(
"Type" ) << tr(
"Format" );
381 mMetadataUrlModel->setHorizontalHeaderLabels( metadataUrlHeaders );
382 tableViewMetadataUrl->setModel( mMetadataUrlModel );
383 tableViewMetadataUrl->setItemDelegate(
new MetadataUrlItemDelegate(
this ) );
388 const int row = mMetadataUrlModel->rowCount();
389 mMetadataUrlModel->setItem( row, 0,
new QStandardItem( metaUrl.url ) );
390 mMetadataUrlModel->setItem( row, 1,
new QStandardItem( metaUrl.type ) );
391 mMetadataUrlModel->setItem( row, 2,
new QStandardItem( metaUrl.format ) );
395 mLayerLegendUrlLineEdit->setText( mLayer->
legendUrl() );
396 mLayerLegendUrlFormatComboBox->setCurrentIndex(
397 mLayerLegendUrlFormatComboBox->findText(
404 const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &wmsDims = serverProperties->
wmsDimensions();
407 addWmsDimensionInfoToTreeWidget( dim );
411 myStyle.append( QStringLiteral(
"body { margin: 10px; }\n " ) );
412 teMetadataViewer->clear();
413 teMetadataViewer->document()->setDefaultStyleSheet( myStyle );
414 teMetadataViewer->setHtml( htmlMetadata() );
415 teMetadataViewer->setOpenLinks(
false );
417 mMetadataFilled =
true;
422 if ( !settings.
contains( QStringLiteral(
"/Windows/VectorLayerProperties/tab" ) ) )
424 settings.
setValue( QStringLiteral(
"Windows/VectorLayerProperties/tab" ),
428 QList<QgsMapLayer *> dependencySources;
429 const QSet<QgsMapLayerDependency> constDependencies = mLayer->
dependencies();
434 dependencySources << layer;
440 connect(
QgsProject::instance(), &QObject::destroyed,
this, [ = ] {mLayersDependenciesTreeView->setModel(
nullptr );} );
441 mLayersDependenciesTreeView->setModel( mLayersDependenciesTreeModel );
443 mRefreshSettingsWidget->setLayer( mLayer );
446 QMenu *menu =
new QMenu(
this );
448 mAuxiliaryLayerActionNew =
new QAction( tr(
"Create" ),
this );
449 menu->addAction( mAuxiliaryLayerActionNew );
450 connect( mAuxiliaryLayerActionNew, &QAction::triggered,
this, &QgsVectorLayerProperties::onAuxiliaryLayerNew );
452 mAuxiliaryLayerActionClear =
new QAction( tr(
"Clear" ),
this );
453 menu->addAction( mAuxiliaryLayerActionClear );
454 connect( mAuxiliaryLayerActionClear, &QAction::triggered,
this, &QgsVectorLayerProperties::onAuxiliaryLayerClear );
456 mAuxiliaryLayerActionDelete =
new QAction( tr(
"Delete" ),
this );
457 menu->addAction( mAuxiliaryLayerActionDelete );
458 connect( mAuxiliaryLayerActionDelete, &QAction::triggered,
this, &QgsVectorLayerProperties::onAuxiliaryLayerDelete );
460 mAuxiliaryLayerActionExport =
new QAction( tr(
"Export" ),
this );
461 menu->addAction( mAuxiliaryLayerActionExport );
464 mAuxiliaryStorageActions->setMenu( menu );
466 connect( mAuxiliaryStorageFieldsDeleteBtn, &QPushButton::clicked,
this, &QgsVectorLayerProperties::onAuxiliaryLayerDeleteField );
467 connect( mAuxiliaryStorageFieldsAddBtn, &QPushButton::clicked,
this, &QgsVectorLayerProperties::onAuxiliaryLayerAddField );
469 updateAuxiliaryStoragePage();
471 mOptsPage_Information->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#information-properties" ) );
472 mOptsPage_Source->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#source-properties" ) );
473 mOptsPage_Style->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#symbology-properties" ) );
474 mOptsPage_Labels->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#labels-properties" ) );
475 mOptsPage_Masks->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#masks-properties" ) );
476 mOptsPage_Diagrams->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#diagrams-properties" ) );
477 mOptsPage_SourceFields->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#fields-properties" ) );
478 mOptsPage_AttributesForm->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#attributes-form-properties" ) );
479 mOptsPage_Joins->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#joins-properties" ) );
480 mOptsPage_AuxiliaryStorage->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#auxiliary-storage-properties" ) );
481 mOptsPage_Actions->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#actions-properties" ) );
482 mOptsPage_Display->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#display-properties" ) );
483 mOptsPage_Rendering->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#rendering-properties" ) );
484 mOptsPage_Temporal->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#temporal-properties" ) );
485 mOptsPage_Variables->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#variables-properties" ) );
486 mOptsPage_Metadata->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#metadata-properties" ) );
487 mOptsPage_DataDependencies->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#dependencies-properties" ) ) ;
488 mOptsPage_Legend->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#legend-properties" ) );
489 mOptsPage_Server->setProperty(
"helpPage", QStringLiteral(
"working_with_vector/vector_properties.html#qgis-server-properties" ) );
497void QgsVectorLayerProperties::toggleEditing()
502 emit toggleEditing( mLayer );
504 setPbnQueryBuilderEnabled();
507void QgsVectorLayerProperties::insertField()
511 if ( mMapTipFieldComboBox->currentField().isEmpty() )
513 QString expression = QStringLiteral(
"[%\"" );
514 expression += mMapTipFieldComboBox->currentField();
515 expression += QLatin1String(
"\"%]" );
517 mMapTipWidget->insertText( expression );
520void QgsVectorLayerProperties::insertOrEditExpression()
523 int selectionStart = mMapTipWidget->selectionStart();
524 int selectionEnd = mMapTipWidget->selectionEnd();
530 exprDlg.setWindowTitle( tr(
"Insert Expression" ) );
531 if ( exprDlg.exec() == QDialog::Accepted && !exprDlg.expressionText().trimmed().isEmpty() )
532 mMapTipWidget->insertText(
"[%" + exprDlg.expressionText().trimmed() +
"%]" );
534 mMapTipWidget->setLinearSelection( selectionStart, selectionEnd );
537void QgsVectorLayerProperties::addMetadataUrl()
539 const int row = mMetadataUrlModel->rowCount();
540 mMetadataUrlModel->setItem( row, 0,
new QStandardItem( QLatin1String() ) );
541 mMetadataUrlModel->setItem( row, 1,
new QStandardItem( QLatin1String() ) );
542 mMetadataUrlModel->setItem( row, 2,
new QStandardItem( QLatin1String() ) );
545void QgsVectorLayerProperties::removeSelectedMetadataUrl()
547 const QModelIndexList selectedRows = tableViewMetadataUrl->selectionModel()->selectedRows();
548 if ( selectedRows.empty() )
550 mMetadataUrlModel->removeRow( selectedRows[0].row() );
555 if ( !mSourceWidget )
560 QHBoxLayout *layout =
new QHBoxLayout();
561 layout->addWidget( mSourceWidget );
562 mSourceGroupBox->setLayout( layout );
563 mSourceGroupBox->show();
567 buttonBox->button( QDialogButtonBox::Apply )->setEnabled( isValid );
568 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( isValid );
577 mLayerOrigNameLineEdit->setText( mLayer->
name() );
578 mBackupCrs = mLayer->
crs();
581 mSubsetGroupBox->setEnabled(
true );
588 txtSubsetSQL->setReadOnly(
true );
589 txtSubsetSQL->setCaretWidth( 0 );
590 txtSubsetSQL->setCaretLineVisible(
false );
591 setPbnQueryBuilderEnabled();
600 mScaleRangeWidget->setMapCanvas(
mCanvas );
603 mReferenceScaleWidget->setShowCurrentScaleButton(
true );
604 mReferenceScaleWidget->setMapCanvas(
mCanvas );
605 if ( mUseReferenceScaleGroupBox->isChecked() )
613 mSimplifyDrawingSpinBox->setValue( simplifyMethod.
threshold() );
614 mSimplifyDrawingSpinBox->setClearValue( 1.0 );
619 mSelectionColorButton->setColor( selectionProperties->
selectionColor() );
623 mSelectionSymbolButton->setSymbol( symbol->clone() );
628 mRadioDefaultSelectionColor->setChecked(
true );
635 mRadioOverrideSelectionColor->setChecked(
true );
639 mRadioDefaultSelectionColor->setChecked(
true );
647 mRadioOverrideSelectionSymbol->setChecked(
true );
651 mRadioDefaultSelectionColor->setChecked(
true );
656 QString remark = QStringLiteral(
" (%1)" ).arg( tr(
"Not supported" ) );
660 mSimplifyDrawingAtProvider->setChecked(
false );
661 mSimplifyDrawingAtProvider->setEnabled(
false );
662 if ( !mSimplifyDrawingAtProvider->text().endsWith( remark ) )
663 mSimplifyDrawingAtProvider->setText( mSimplifyDrawingAtProvider->text().append( remark ) );
668 mSimplifyDrawingAtProvider->setEnabled( mSimplifyDrawingGroupBox->isChecked() );
669 if ( mSimplifyDrawingAtProvider->text().endsWith( remark ) )
671 QString newText = mSimplifyDrawingAtProvider->text();
672 newText.chop( remark.size() );
673 mSimplifyDrawingAtProvider->setText( newText );
680 mSimplifyDrawingGroupBox->setChecked(
false );
681 mSimplifyDrawingGroupBox->setEnabled(
false );
688 mSimplifyAlgorithmComboBox->setCurrentIndex( mSimplifyAlgorithmComboBox->findData( simplifyMethod.
simplifyAlgorithm() ) );
691 myScalesList.append( QStringLiteral(
"1:1" ) );
692 mSimplifyMaximumScaleComboBox->updateScales( myScalesList );
693 mSimplifyMaximumScaleComboBox->setScale( simplifyMethod.
maximumScale() );
697 mRefreshSettingsWidget->syncToLayer();
705 updateSymbologyPage();
709 if ( labelingDialog )
712 mSourceFieldsPropertiesDialog->
init();
713 mAttributesFormPropertiesDialog->
init();
716 updateVariableEditor();
718 if ( diagramPropertiesDialog )
724 page->syncToLayer( mLayer );
731 mLegendWidget->setLayer( mLayer );
739 const QString newSource = mSourceWidget->
sourceUri();
740 if ( newSource != mLayer->
source() )
747 if ( labelingDialog )
751 mBackupCrs = mLayer->
crs();
753 mLegendWidget->applyToLayer();
754 mLegendConfigEmbeddedWidget->applyToLayer();
758 mMetadataFilled =
false;
761 if ( mMaskingWidget && mMaskingWidget->hasBeenPopulated() )
762 mMaskingWidget->apply();
767 mSubsetGroupBox->setEnabled(
true );
773 mMetadataFilled =
false;
796 const auto constActions = mActionDialog->
actions();
797 for (
const QgsAction &action : constActions )
804 QVector<QgsAttributeTableConfig::ColumnConfig> columns = attributeTableConfig.
columns();
806 for (
int i = 0; i < columns.size(); ++i )
818 mLayer->
setName( mLayerOrigNameLineEdit->text() );
820 mAttributesFormPropertiesDialog->
apply();
821 mSourceFieldsPropertiesDialog->
apply();
833 diagramPropertiesDialog->
apply();
842 if ( mLayer->
shortName() != mLayerShortNameLineEdit->text() )
843 mMetadataFilled =
false;
844 mLayer->
setShortName( mLayerShortNameLineEdit->text() );
846 if ( mLayer->
title() != mLayerTitleLineEdit->text() )
847 mMetadataFilled =
false;
848 mLayer->
setTitle( mLayerTitleLineEdit->text() );
850 if ( mLayer->
abstract() != mLayerAbstractTextEdit->toPlainText() )
851 mMetadataFilled =
false;
852 mLayer->
setAbstract( mLayerAbstractTextEdit->toPlainText() );
854 if ( mLayer->
keywordList() != mLayerKeywordListLineEdit->text() )
855 mMetadataFilled =
false;
858 if ( mLayer->
dataUrl() != mLayerDataUrlLineEdit->text() )
859 mMetadataFilled =
false;
860 mLayer->
setDataUrl( mLayerDataUrlLineEdit->text() );
862 if ( mLayer->
dataUrlFormat() != mLayerDataUrlFormatComboBox->currentText() )
863 mMetadataFilled =
false;
867 if ( mLayer->
attribution() != mLayerAttributionLineEdit->text() )
868 mMetadataFilled =
false;
871 if ( mLayer->
attributionUrl() != mLayerAttributionUrlLineEdit->text() )
872 mMetadataFilled =
false;
876 QList<QgsMapLayerServerProperties::MetadataUrl> metaUrls;
877 for (
int row = 0; row < mMetadataUrlModel->rowCount() ; row++ )
880 metaUrl.
url = mMetadataUrlModel->item( row, 0 )->text();
881 metaUrl.
type = mMetadataUrlModel->item( row, 1 )->text();
882 metaUrl.
format = mMetadataUrlModel->item( row, 2 )->text();
883 metaUrls.append( metaUrl );
884 mMetadataFilled =
false;
889 if ( mLayer->
legendUrl() != mLayerLegendUrlLineEdit->text() )
890 mMetadataFilled =
false;
891 mLayer->
setLegendUrl( mLayerLegendUrlLineEdit->text() );
893 if ( mLayer->
legendUrlFormat() != mLayerLegendUrlFormatComboBox->currentText() )
894 mMetadataFilled =
false;
899 if ( mSimplifyDrawingGroupBox->isChecked() )
907 simplifyMethod.
setThreshold( mSimplifyDrawingSpinBox->value() );
909 simplifyMethod.
setMaximumScale( mSimplifyMaximumScaleComboBox->scale() );
920 if ( mSelectionColorButton->color() != mSelectionColorButton->defaultColor() )
924 if (
QgsSymbol *symbol = mSelectionSymbolButton->symbol() )
927 if ( mRadioOverrideSelectionSymbol->isChecked() )
931 else if ( mRadioOverrideSelectionColor->isChecked() )
940 mRefreshSettingsWidget->saveToLayer();
943 mLayer->
setRefreshOnNofifyMessage( mNotificationMessageCheckBox->isChecked() ? mNotifyMessagValueLineEdit->text() : QString() );
949 updateVariableEditor();
952 QSet<QgsMapLayerDependency> deps;
953 const auto checkedLayers = mLayersDependenciesTreeModel->
checkedLayers();
958 QMessageBox::warning(
nullptr, tr(
"Save Dependency" ), tr(
"This configuration introduces a cycle in data dependencies and will be ignored." ) );
963 mProjectDirtyBlocker.reset();
976 const auto constVectorJoins = mLayer->
vectorJoins();
998 if ( backupCrs != mLayer->
crs() )
999 mLayer->
setCrs( backupCrs );
1003void QgsVectorLayerProperties::pbnQueryBuilder_clicked()
1012 if ( dialog->exec() )
1026void QgsVectorLayerProperties::pbnIndex_clicked()
1031 setCursor( Qt::WaitCursor );
1033 setCursor( Qt::ArrowCursor );
1036 pbnIndex->setEnabled(
false );
1037 pbnIndex->setText( tr(
"Spatial Index Exists" ) );
1038 QMessageBox::information(
this, tr(
"Spatial Index" ), tr(
"Creation of spatial index successful" ) );
1042 QMessageBox::warning(
this, tr(
"Spatial Index" ), tr(
"Creation of spatial index failed" ) );
1047QString QgsVectorLayerProperties::htmlMetadata()
1057 mMetadataFilled =
false;
1061void QgsVectorLayerProperties::saveMultipleStylesAs()
1064 dlg.setSaveOnlyCurrentStyle(
false );
1073 const QListWidget *stylesWidget { dlg.stylesWidget() };
1076 QStringList stylesSelected;
1077 for (
int i = 0; i < stylesWidget->count(); i++ )
1079 if ( stylesWidget->item( i )->checkState() == Qt::CheckState::Checked )
1081 stylesSelected.push_back( stylesWidget->item( i )->text() );
1085 if ( ! stylesSelected.isEmpty() )
1088 for (
const QString &styleName : std::as_const( stylesSelected ) )
1090 bool defaultLoadedFlag =
false;
1092 StyleType type = dlg.currentStyleType();
1100 const QString filePath { dlg.outputFilePath() };
1101 const QFileInfo fi { filePath };
1102 QString safePath { QString( filePath ).replace( fi.baseName(),
1104 if ( styleIndex > 0 && stylesSelected.count( ) > 1 )
1107 while ( QFile::exists( safePath ) )
1109 const QFileInfo fi { safePath };
1110 safePath = QString( safePath ).replace(
'.' + fi.completeSuffix(),
1111 QStringLiteral(
"_%1.%2" ).arg( QString::number( i ), fi.completeSuffix() ) );
1116 message = mLayer->
saveNamedStyle( safePath, defaultLoadedFlag, dlg.styleCategories() );
1118 message = mLayer->
saveSldStyle( safePath, defaultLoadedFlag );
1121 if ( defaultLoadedFlag )
1128 QMessageBox::information(
this, tr(
"Save Style" ), message );
1135 QString infoWindowTitle = QObject::tr(
"Save style '%1' to DB (%2)" )
1142 QString name { dbSettings.
name };
1143 if ( name.isEmpty() )
1149 name += QStringLiteral(
"_%1" ).arg( styleName );
1150 QStringList ids, names, descriptions;
1153 while ( names.contains( name ) )
1155 name = QStringLiteral(
"%1 %2" ).arg( name, QString::number( i ) );
1160 QString errorMessage;
1163 if ( QMessageBox::question(
nullptr, QObject::tr(
"Save style in database" ),
1164 QObject::tr(
"A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
1165 QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
1170 else if ( !errorMessage.isEmpty() )
1172 QMessageBox::warning(
this, infoWindowTitle, errorMessage );
1178 if ( !msgError.isNull() )
1180 QMessageBox::warning(
this, infoWindowTitle, msgError );
1184 QMessageBox::information(
this, infoWindowTitle, tr(
"Style '%1' saved" ).arg( styleName ) );
1199void QgsVectorLayerProperties::aboutToShowStyleMenu()
1202 QMenu *m = qobject_cast<QMenu *>( sender() );
1205 m->addAction( mActionLoadStyle );
1206 m->addAction( mActionSaveStyle );
1211 mActionSaveStyle->setText( tr(
"Save Current Style…" ) );
1212 m->addAction( mActionSaveMultipleStyles );
1216 mActionSaveStyle->setText( tr(
"Save Style…" ) );
1228void QgsVectorLayerProperties::mButtonAddJoin_clicked()
1233 QList<QgsMapLayer *> joinedLayers;
1234 const QList< QgsVectorLayerJoinInfo > &joins = mLayer->
vectorJoins();
1235 joinedLayers.reserve( joins.size() );
1236 for (
int i = 0; i < joins.size(); ++i )
1238 joinedLayers.append( joins[i].joinLayer() );
1242 if ( d.exec() == QDialog::Accepted )
1246 if ( d.createAttributeIndex() )
1255 addJoinToTreeWidget( info );
1256 setPbnQueryBuilderEnabled();
1257 mSourceFieldsPropertiesDialog->
init();
1258 mAttributesFormPropertiesDialog->
init();
1262void QgsVectorLayerProperties::mButtonEditJoin_clicked()
1264 QTreeWidgetItem *currentJoinItem = mJoinTreeWidget->currentItem();
1265 mJoinTreeWidget_itemDoubleClicked( currentJoinItem, 0 );
1268void QgsVectorLayerProperties::mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item,
int )
1270 if ( !mLayer || !item )
1275 QList<QgsMapLayer *> joinedLayers;
1276 QString joinLayerId = item->data( 0, Qt::UserRole ).toString();
1277 const QList< QgsVectorLayerJoinInfo > &joins = mLayer->
vectorJoins();
1279 for (
int i = 0; i < joins.size(); ++i )
1285 if ( joinLayer->
id() == joinLayerId )
1292 joinedLayers.append( joinLayer );
1301 d.setWindowTitle( tr(
"Edit Vector Join" ) );
1302 d.setJoinInfo( joins[j] );
1304 if ( d.exec() == QDialog::Accepted )
1310 int idx = mJoinTreeWidget->indexOfTopLevelItem( item );
1311 mJoinTreeWidget->takeTopLevelItem( idx );
1316 if ( d.createAttributeIndex() )
1325 addJoinToTreeWidget( info, idx );
1327 setPbnQueryBuilderEnabled();
1328 mSourceFieldsPropertiesDialog->
init();
1329 mAttributesFormPropertiesDialog->
init();
1333void QgsVectorLayerProperties::addJoinToTreeWidget(
const QgsVectorLayerJoinInfo &join,
const int insertIndex )
1335 QTreeWidgetItem *joinItem =
new QTreeWidgetItem();
1336 joinItem->setFlags( Qt::ItemIsEnabled );
1339 if ( !mLayer || !joinLayer )
1344 joinItem->setText( 0, tr(
"Join layer" ) );
1350 joinItem->setText( 1, joinLayer->
name() );
1352 QFont f = joinItem->font( 0 );
1354 joinItem->setFont( 0, f );
1355 joinItem->setFont( 1, f );
1357 joinItem->setData( 0, Qt::UserRole, join.
joinLayerId() );
1359 QTreeWidgetItem *childJoinField =
new QTreeWidgetItem();
1360 childJoinField->setText( 0, tr(
"Join field" ) );
1362 childJoinField->setFlags( Qt::ItemIsEnabled );
1363 joinItem->addChild( childJoinField );
1365 QTreeWidgetItem *childTargetField =
new QTreeWidgetItem();
1366 childTargetField->setText( 0, tr(
"Target field" ) );
1368 joinItem->addChild( childTargetField );
1370 QTreeWidgetItem *childMemCache =
new QTreeWidgetItem();
1371 childMemCache->setText( 0, tr(
"Cache join layer in virtual memory" ) );
1373 childMemCache->setText( 1, QChar( 0x2714 ) );
1374 joinItem->addChild( childMemCache );
1376 QTreeWidgetItem *childDynForm =
new QTreeWidgetItem();
1377 childDynForm->setText( 0, tr(
"Dynamic form" ) );
1379 childDynForm->setText( 1, QChar( 0x2714 ) );
1380 joinItem->addChild( childDynForm );
1382 QTreeWidgetItem *childEditable =
new QTreeWidgetItem();
1383 childEditable->setText( 0, tr(
"Editable join layer" ) );
1385 childEditable->setText( 1, QChar( 0x2714 ) );
1386 joinItem->addChild( childEditable );
1388 QTreeWidgetItem *childUpsert =
new QTreeWidgetItem();
1389 childUpsert->setText( 0, tr(
"Upsert on edit" ) );
1391 childUpsert->setText( 1, QChar( 0x2714 ) );
1392 joinItem->addChild( childUpsert );
1394 QTreeWidgetItem *childCascade =
new QTreeWidgetItem();
1395 childCascade->setText( 0, tr(
"Delete cascade" ) );
1397 childCascade->setText( 1, QChar( 0x2714 ) );
1398 joinItem->addChild( childCascade );
1400 QTreeWidgetItem *childPrefix =
new QTreeWidgetItem();
1401 childPrefix->setText( 0, tr(
"Custom field name prefix" ) );
1402 childPrefix->setText( 1, join.
prefix() );
1403 joinItem->addChild( childPrefix );
1405 QTreeWidgetItem *childFields =
new QTreeWidgetItem();
1406 childFields->setText( 0, tr(
"Joined fields" ) );
1409 childFields->setText( 1, QLocale().toString( list->count() ) );
1411 childFields->setText( 1, tr(
"all" ) );
1412 joinItem->addChild( childFields );
1414 if ( insertIndex >= 0 )
1415 mJoinTreeWidget->insertTopLevelItem( insertIndex, joinItem );
1417 mJoinTreeWidget->addTopLevelItem( joinItem );
1419 mJoinTreeWidget->setCurrentItem( joinItem );
1420 mJoinTreeWidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
1430 QDialog *dlg =
new QDialog();
1431 QString key = QStringLiteral(
"/UI/paneldialog/%1" ).arg( panel->
panelTitle() );
1433 dlg->restoreGeometry( settings.
value( key ).toByteArray() );
1435 dlg->setLayout(
new QVBoxLayout() );
1436 dlg->layout()->addWidget( panel );
1437 QDialogButtonBox *buttonBox =
new QDialogButtonBox( QDialogButtonBox::Ok );
1438 connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
1439 dlg->layout()->addWidget( buttonBox );
1441 settings.
setValue( key, dlg->saveGeometry() );
1445void QgsVectorLayerProperties::mButtonRemoveJoin_clicked()
1447 QTreeWidgetItem *currentJoinItem = mJoinTreeWidget->currentItem();
1448 if ( !mLayer || !currentJoinItem )
1453 mLayer->
removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );
1454 mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
1455 setPbnQueryBuilderEnabled();
1456 mSourceFieldsPropertiesDialog->
init();
1457 mAttributesFormPropertiesDialog->
init();
1461void QgsVectorLayerProperties::mButtonAddWmsDimension_clicked()
1467 QStringList alreadyDefinedDimensions;
1469 const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &dims = serverProperties->
wmsDimensions();
1472 alreadyDefinedDimensions << dim.name;
1476 if ( d.exec() == QDialog::Accepted )
1481 addWmsDimensionInfoToTreeWidget( info );
1485void QgsVectorLayerProperties::mButtonEditWmsDimension_clicked()
1487 QTreeWidgetItem *currentWmsDimensionItem = mWmsDimensionsTreeWidget->currentItem();
1488 mWmsDimensionsTreeWidget_itemDoubleClicked( currentWmsDimensionItem, 0 );
1491void QgsVectorLayerProperties::mWmsDimensionsTreeWidget_itemDoubleClicked( QTreeWidgetItem *item,
int )
1493 if ( !mLayer || !item )
1498 QString wmsDimName = item->data( 0, Qt::UserRole ).toString();
1500 const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &dims = serverProperties->
wmsDimensions();
1501 QStringList alreadyDefinedDimensions;
1503 for (
int i = 0; i < dims.size(); ++i )
1505 QString dimName = dims[i].name;
1506 if ( dimName == wmsDimName )
1512 alreadyDefinedDimensions << dimName;
1521 d.setWindowTitle( tr(
"Edit WMS Dimension" ) );
1522 d.setInfo( dims[j] );
1524 if ( d.exec() == QDialog::Accepted )
1531 int idx = mWmsDimensionsTreeWidget->indexOfTopLevelItem( item );
1532 mWmsDimensionsTreeWidget->takeTopLevelItem( idx );
1536 addWmsDimensionInfoToTreeWidget( info, idx );
1542 QTreeWidgetItem *wmsDimensionItem =
new QTreeWidgetItem();
1543 wmsDimensionItem->setFlags( Qt::ItemIsEnabled );
1545 wmsDimensionItem->setText( 0, tr(
"Dimension" ) );
1546 wmsDimensionItem->setText( 1, wmsDim.
name );
1548 QFont f = wmsDimensionItem->font( 0 );
1550 wmsDimensionItem->setFont( 0, f );
1551 wmsDimensionItem->setFont( 1, f );
1553 wmsDimensionItem->setData( 0, Qt::UserRole, wmsDim.
name );
1555 QTreeWidgetItem *childWmsDimensionField =
new QTreeWidgetItem();
1556 childWmsDimensionField->setText( 0, tr(
"Field" ) );
1557 childWmsDimensionField->setText( 1, wmsDim.
fieldName );
1558 childWmsDimensionField->setFlags( Qt::ItemIsEnabled );
1559 wmsDimensionItem->addChild( childWmsDimensionField );
1561 QTreeWidgetItem *childWmsDimensionEndField =
new QTreeWidgetItem();
1562 childWmsDimensionEndField->setText( 0, tr(
"End field" ) );
1563 childWmsDimensionEndField->setText( 1, wmsDim.
endFieldName );
1564 childWmsDimensionEndField->setFlags( Qt::ItemIsEnabled );
1565 wmsDimensionItem->addChild( childWmsDimensionEndField );
1567 QTreeWidgetItem *childWmsDimensionUnits =
new QTreeWidgetItem();
1568 childWmsDimensionUnits->setText( 0, tr(
"Units" ) );
1569 childWmsDimensionUnits->setText( 1, wmsDim.
units );
1570 childWmsDimensionUnits->setFlags( Qt::ItemIsEnabled );
1571 wmsDimensionItem->addChild( childWmsDimensionUnits );
1573 QTreeWidgetItem *childWmsDimensionUnitSymbol =
new QTreeWidgetItem();
1574 childWmsDimensionUnitSymbol->setText( 0, tr(
"Unit symbol" ) );
1575 childWmsDimensionUnitSymbol->setText( 1, wmsDim.
unitSymbol );
1576 childWmsDimensionUnitSymbol->setFlags( Qt::ItemIsEnabled );
1577 wmsDimensionItem->addChild( childWmsDimensionUnitSymbol );
1579 QTreeWidgetItem *childWmsDimensionDefaultValue =
new QTreeWidgetItem();
1580 childWmsDimensionDefaultValue->setText( 0, tr(
"Default display" ) );
1582 childWmsDimensionDefaultValue->setFlags( Qt::ItemIsEnabled );
1583 wmsDimensionItem->addChild( childWmsDimensionDefaultValue );
1585 QTreeWidgetItem *childWmsDimensionRefValue =
new QTreeWidgetItem();
1586 childWmsDimensionRefValue->setText( 0, tr(
"Reference value" ) );
1587 childWmsDimensionRefValue->setText( 1, wmsDim.
referenceValue.toString() );
1588 childWmsDimensionRefValue->setFlags( Qt::ItemIsEnabled );
1589 wmsDimensionItem->addChild( childWmsDimensionRefValue );
1591 if ( insertIndex >= 0 )
1592 mWmsDimensionsTreeWidget->insertTopLevelItem( insertIndex, wmsDimensionItem );
1594 mWmsDimensionsTreeWidget->addTopLevelItem( wmsDimensionItem );
1596 mWmsDimensionsTreeWidget->setCurrentItem( wmsDimensionItem );
1597 mWmsDimensionsTreeWidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
1600void QgsVectorLayerProperties::mButtonRemoveWmsDimension_clicked()
1602 QTreeWidgetItem *currentWmsDimensionItem = mWmsDimensionsTreeWidget->currentItem();
1603 if ( !mLayer || !currentWmsDimensionItem )
1609 serverProperties->
removeWmsDimension( currentWmsDimensionItem->data( 0, Qt::UserRole ).toString() );
1610 mWmsDimensionsTreeWidget->takeTopLevelItem( mWmsDimensionsTreeWidget->indexOfTopLevelItem( currentWmsDimensionItem ) );
1614void QgsVectorLayerProperties::updateSymbologyPage()
1618 delete mRendererDialog;
1619 mRendererDialog =
nullptr;
1635 mOptsPage_Style->setEnabled(
false );
1638 if ( mRendererDialog )
1640 mRendererDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
1641 widgetStackRenderers->addWidget( mRendererDialog );
1642 widgetStackRenderers->setCurrentWidget( mRendererDialog );
1643 widgetStackRenderers->currentWidget()->layout()->setContentsMargins( 0, 0, 0, 0 );
1647void QgsVectorLayerProperties::setPbnQueryBuilderEnabled()
1649 pbnQueryBuilder->setEnabled( mLayer &&
1656 pbnQueryBuilder->setToolTip( tr(
"Stop editing mode to enable this." ) );
1661void QgsVectorLayerProperties::pbnUpdateExtents_clicked()
1664 mMetadataFilled =
false;
1671 if ( index ==
mOptStackedWidget->indexOf( mOptsPage_Information ) && ! mMetadataFilled )
1674 teMetadataViewer->clear();
1675 teMetadataViewer->setHtml( htmlMetadata() );
1676 mMetadataFilled =
true;
1682void QgsVectorLayerProperties::mSimplifyDrawingGroupBox_toggled(
bool checked )
1687 mSimplifyDrawingAtProvider->setEnabled(
false );
1691 mSimplifyDrawingAtProvider->setEnabled( checked );
1695void QgsVectorLayerProperties::updateVariableEditor()
1698 mVariableEditor->setContext( &context );
1702 mVariableEditor->reloadContext();
1703 mVariableEditor->setEditableScopeIndex( 2 );
1706void QgsVectorLayerProperties::showHelp()
1708 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property(
"helpPage" );
1710 if ( helpPage.isValid() )
1716 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/vector_properties.html" ) );
1720void QgsVectorLayerProperties::updateAuxiliaryStoragePage()
1727 mAuxiliaryStorageInformationGrpBox->setEnabled(
true );
1728 mAuxiliaryStorageFieldsGrpBox->setEnabled(
true );
1735 mAuxiliaryStorageFeaturesLineEdit->setText( QLocale().toString( features ) );
1738 mAuxiliaryLayerActionClear->setEnabled(
true );
1739 mAuxiliaryLayerActionDelete->setEnabled(
true );
1740 mAuxiliaryLayerActionExport->setEnabled(
true );
1741 mAuxiliaryLayerActionNew->setEnabled(
false );
1747 mAuxiliaryStorageFieldsLineEdit->setText( QLocale().toString( fields ) );
1750 mAuxiliaryStorageFieldsTree->clear();
1751 for (
const QgsField &field : alayer->auxiliaryFields() )
1754 QTreeWidgetItem *item =
new QTreeWidgetItem();
1756 item->setText( 0, prop.
origin() );
1757 item->setText( 1, prop.
name() );
1758 item->setText( 2, prop.
comment() );
1759 item->setText( 3, field.typeName() );
1760 item->setText( 4, field.name() );
1762 mAuxiliaryStorageFieldsTree->addTopLevelItem( item );
1768 mAuxiliaryStorageInformationGrpBox->setEnabled(
false );
1769 mAuxiliaryStorageFieldsGrpBox->setEnabled(
false );
1771 mAuxiliaryLayerActionClear->setEnabled(
false );
1772 mAuxiliaryLayerActionDelete->setEnabled(
false );
1773 mAuxiliaryLayerActionExport->setEnabled(
false );
1774 mAuxiliaryLayerActionNew->setEnabled(
true );
1776 mAuxiliaryStorageFieldsTree->clear();
1777 mAuxiliaryStorageKeyLineEdit->setText( QString() );
1778 mAuxiliaryStorageFieldsLineEdit->setText( QString() );
1779 mAuxiliaryStorageFeaturesLineEdit->setText( QString() );
1783void QgsVectorLayerProperties::onAuxiliaryLayerNew()
1791 if ( dlg.exec() == QDialog::Accepted )
1793 updateAuxiliaryStoragePage();
1797void QgsVectorLayerProperties::onAuxiliaryLayerClear()
1804 const QString msg = tr(
"Are you sure you want to clear auxiliary data for %1?" ).arg( mLayer->
name() );
1805 QMessageBox::StandardButton reply;
1806 reply = QMessageBox::question(
this,
"Clear Auxiliary Data", msg, QMessageBox::Yes | QMessageBox::No );
1808 if ( reply == QMessageBox::Yes )
1810 QApplication::setOverrideCursor( Qt::WaitCursor );
1812 QApplication::restoreOverrideCursor();
1813 updateAuxiliaryStoragePage();
1818void QgsVectorLayerProperties::onAuxiliaryLayerDelete()
1824 const QString msg = tr(
"Are you sure you want to delete auxiliary storage for %1?" ).arg( mLayer->
name() );
1825 QMessageBox::StandardButton reply;
1826 reply = QMessageBox::question(
this,
"Delete Auxiliary Storage", msg, QMessageBox::Yes | QMessageBox::No );
1828 if ( reply == QMessageBox::Yes )
1830 QApplication::setOverrideCursor( Qt::WaitCursor );
1843 QApplication::restoreOverrideCursor();
1844 updateAuxiliaryStoragePage();
1849void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
1855 QList<QTreeWidgetItem *> items = mAuxiliaryStorageFieldsTree->selectedItems();
1856 if ( items.count() < 1 )
1860 const QTreeWidgetItem *item = items[0];
1863 def.
setName( item->text( 1 ) );
1873 const QString msg = tr(
"Are you sure you want to delete auxiliary field %1 for %2?" ).arg( item->text( 1 ), item->text( 0 ) );
1875 QMessageBox::StandardButton reply;
1876 const QString title = QObject::tr(
"Delete Auxiliary Field" );
1877 reply = QMessageBox::question(
this, title, msg, QMessageBox::Yes | QMessageBox::No );
1879 if ( reply == QMessageBox::Yes )
1881 QApplication::setOverrideCursor( Qt::WaitCursor );
1882 deleteAuxiliaryField( index );
1884 QApplication::restoreOverrideCursor();
1888void QgsVectorLayerProperties::onAuxiliaryLayerAddField()
1895 if ( dlg.exec() == QDialog::Accepted )
1897 updateAuxiliaryStoragePage();
1901void QgsVectorLayerProperties::deleteAuxiliaryField(
int index )
1914 if ( key >= 0 && def.
origin().compare(
"labeling", Qt::CaseInsensitive ) == 0
1921 updateAuxiliaryStoragePage();
1922 mSourceFieldsPropertiesDialog->
init();
1926 const QString title = QObject::tr(
"Delete Auxiliary Field" );
1928 const QString msg = QObject::tr(
"Unable to remove auxiliary field (%1)" ).arg( errors );
1936 if ( obj == mMapTipPreviewContainer && ev->type() == QEvent::Resize )
1940 return QgsOptionsDialogBase::eventFilter( obj, ev );
1943void QgsVectorLayerProperties::initMapTipPreview()
1946 mMapTipSplitter->setSizes( { 400, 200 } );
1948 mMapTipPreviewContainer->installEventFilter(
this );
1952 mMapTipPreview =
new QgsWebView( mMapTipPreviewContainer );
1955 mMapTipPreview->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
1956 mMapTipPreview->setContextMenuPolicy( Qt::NoContextMenu );
1957 connect( mMapTipPreview, &QWebView::loadFinished,
this, &QgsVectorLayerProperties::resizeMapTip );
1960 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled,
true );
1961 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled,
true );
1962 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::LocalStorageEnabled,
true );
1965 mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
1966 mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
1969 connect( mMapTipWidget, &QgsCodeEditorHTML::textChanged,
this, &QgsVectorLayerProperties::updateMapTipPreview );
1973void QgsVectorLayerProperties::updateMapTipPreview()
1975 mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
1977 mMapTipPreview->setHtml( htmlContent );
1980void QgsVectorLayerProperties::resizeMapTip()
1983 mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
1986 const QWebElement container = mMapTipPreview->page()->mainFrame()->findFirstElement(
1987 QStringLiteral(
"#QgsWebViewContainer" ) );
1988 const int width = container.geometry().width();
1989 const int height = container.geometry().height();
1990 mMapTipPreview->resize( width, height );
1993 mMapTipPreview->move( ( mMapTipPreviewContainer->width() - mMapTipPreview->width() ) / 2,
1994 ( mMapTipPreviewContainer->height() - mMapTipPreview->height() ) / 2 );
1997 mMapTipPreview->adjustSize();
@ Warning
Warning message.
static QString defaultProjectScales()
A string with default project scales.
@ 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.
void syncToLayer()
Updates the widget to reflect the layer's current diagram settings.
void auxiliaryFieldCreated()
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.
@ SpatialIndexPresent
A valid spatial index exists for the source.
virtual 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.
int indexFromName(const QString &fieldName) const
Gets the field index from the field name.
int indexOf(const QString &fieldName) const
Gets the field index from the field name.
int count() const
Returns number of items.
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.
double scale() const
Returns the last reported scale of the canvas.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
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 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.
void setShortName(const QString &shortName)
Sets the short name of the layer used by QGIS Server to identify the layer.
QString legendUrlFormat() const
Returns the format for a URL based layer legend.
void setRefreshOnNotifyEnabled(bool enabled)
Set whether provider notification is connected to triggerRepaint.
void setAbstract(const QString &abstract)
Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
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.
QString attribution() const
Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
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.
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
void setAttributionUrl(const QString &attribUrl)
Sets the attribution URL of the layer used by QGIS Server in GetCapabilities request.
void setMaximumScale(double scale)
Sets the maximum map scale (i.e.
QgsLayerMetadata metadata
QString abstract() const
Returns the abstract 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 setDataUrl(const QString &dataUrl)
Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
void setKeywordList(const QString &keywords)
Sets the keyword list 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.
bool isRefreshOnNotifyEnabled() const
Returns true if the refresh on provider nofification is enabled.
QString shortName() const
Returns the short name of the layer used by QGIS Server to identify the layer.
void setDataUrlFormat(const QString &dataUrlFormat)
Sets the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
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.
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
void setScaleBasedVisibility(bool enabled)
Sets whether scale based visibility is enabled for the layer.
QString dataUrl() const
Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
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.
QString attributionUrl() const
Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
void setDataSource(const QString &dataSource, const QString &baseName, const QString &provider, bool loadDefaultStyleFlag=false)
Updates the data source of the 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.
QString keywordList() const
Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
void setTitle(const QString &title)
Sets the title of the layer used by QGIS Server in GetCapabilities request.
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
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()
Returns 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.
@ 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.
virtual bool createSpatialIndex()
Creates a spatial index on the datasource (if supported by the provider type).
virtual bool createAttributeIndex(int field)
Create an attribute index on the datasource.
QString encoding() const
Returns the encoding which is used for accessing data.
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
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.
QgsFields fields() const FINAL
Returns the list of fields of 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,...
void setSimplifyHints(SimplifyHints simplifyHints)
Sets the simplification hints of the vector layer managed.
float maximumScale() const
Gets the maximum scale at which the layer should be simplified.
void setThreshold(float threshold)
Sets the simplification threshold of the vector layer managed.
void setSimplifyAlgorithm(SimplifyAlgorithm simplifyAlgorithm)
Sets the local simplification algorithm of the vector layer managed.
void setForceLocalOptimization(bool localOptimization)
Sets where the simplification executes, after fetch the geometries from provider, or when supported,...
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
SimplifyAlgorithm simplifyAlgorithm() const
Gets the local simplification algorithm of the vector layer managed.
float threshold() const
Gets the simplification threshold of the vector layer managed.
@ GeometrySimplification
The geometries can be simplified using the current map2pixel context state.
@ AntialiasingSimplification
The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'.
@ NoSimplification
No simplification can be applied.
SimplifyAlgorithm
Types of local simplification algorithms that can be used.
@ 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...
void setMaximumScale(float maximumScale)
Sets the maximum scale at which the layer should be simplified.
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.