77#include <QDesktopServices> 
   87#include <QColorDialog> 
   90#include <QRegularExpressionValidator> 
  101  , mMessageBar( messageBar )
 
  103  , mOriginalSubsetSQL( lyr->subsetString() )
 
  106  connect( pbnQueryBuilder, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::pbnQueryBuilder_clicked );
 
  107  connect( pbnIndex, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::pbnIndex_clicked );
 
  109  connect( pbnUpdateExtents, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::pbnUpdateExtents_clicked );
 
  110  connect( mButtonAddJoin, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::mButtonAddJoin_clicked );
 
  111  connect( mButtonEditJoin, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::mButtonEditJoin_clicked );
 
  112  connect( mJoinTreeWidget, &QTreeWidget::itemDoubleClicked, 
this, &QgsVectorLayerProperties::mJoinTreeWidget_itemDoubleClicked );
 
  113  connect( mButtonRemoveJoin, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::mButtonRemoveJoin_clicked );
 
  114  connect( mButtonAddWmsDimension, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::mButtonAddWmsDimension_clicked );
 
  115  connect( mButtonEditWmsDimension, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::mButtonEditWmsDimension_clicked );
 
  116  connect( mWmsDimensionsTreeWidget, &QTreeWidget::itemDoubleClicked, 
this, &QgsVectorLayerProperties::mWmsDimensionsTreeWidget_itemDoubleClicked );
 
  117  connect( mButtonRemoveWmsDimension, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::mButtonRemoveWmsDimension_clicked );
 
  118  connect( mSimplifyDrawingGroupBox, &QGroupBox::toggled, 
this, &QgsVectorLayerProperties::mSimplifyDrawingGroupBox_toggled );
 
  119  connect( buttonRemoveMetadataUrl, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::removeSelectedMetadataUrl );
 
  120  connect( buttonAddMetadataUrl, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::addMetadataUrl );
 
  121  connect( buttonBox, &QDialogButtonBox::helpRequested, 
this, &QgsVectorLayerProperties::showHelp );
 
  130  mBtnStyle = 
new QPushButton( tr( 
"Style" ), 
this );
 
  131  QMenu *menuStyle = 
new QMenu( 
this );
 
  132  mActionLoadStyle = 
new QAction( tr( 
"Load Style…" ), 
this );
 
  135  mActionSaveStyle = 
new QAction( tr( 
"Save Current Style…" ), 
this );
 
  138  mActionSaveMultipleStyles = 
new QAction( tr( 
"Save Multiple Styles…" ), 
this );
 
  139  connect( mActionSaveMultipleStyles, &QAction::triggered, 
this, &QgsVectorLayerProperties::saveMultipleStylesAs );
 
  141  mSourceGroupBox->hide();
 
  144  connect( menuStyle, &QMenu::aboutToShow, 
this, &QgsVectorLayerProperties::aboutToShowStyleMenu );
 
  145  buttonBox->addButton( 
mBtnStyle, QDialogButtonBox::ResetRole );
 
  159  mMapTipFieldComboBox->setLayer( lyr );
 
  160  mDisplayExpressionWidget->setLayer( lyr );
 
  161  mDisplayExpressionWidget->registerExpressionContextGenerator( 
this );
 
  164  connect( mMapTipInsertFieldButton, &QAbstractButton::clicked, 
this, &QgsVectorLayerProperties::insertField );
 
  165  connect( mMapTipInsertExpressionButton, &QAbstractButton::clicked, 
this, &QgsVectorLayerProperties::insertOrEditExpression );
 
  170  connect( mEnableMapTips, &QAbstractButton::toggled, mHtmlMapTipGroupBox, &QWidget::setEnabled );
 
  173  QVBoxLayout *layout = 
nullptr;
 
  178    layout = 
new QVBoxLayout( labelingFrame );
 
  179    layout->setContentsMargins( 0, 0, 0, 0 );
 
  181    labelingDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  183    layout->addWidget( labelingDialog );
 
  184    labelingFrame->setLayout( layout );
 
  187    layout = 
new QVBoxLayout( mMaskingFrame );
 
  188    layout->setContentsMargins( 0, 0, 0, 0 );
 
  189    mMaskingWidget = 
new QgsMaskingWidget( mMaskingFrame );
 
  190    mMaskingWidget->setLayer( mLayer );
 
  191    mMaskingWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  192    layout->addWidget( mMaskingWidget );
 
  193    mMaskingFrame->setLayout( layout );
 
  197    labelingDialog = 
nullptr;
 
  198    mOptsPage_Labels->setEnabled( 
false ); 
 
  199    mOptsPage_Masks->setEnabled( 
false ); 
 
  200    mGeomGroupBox->setEnabled( 
false );
 
  201    mGeomGroupBox->setVisible( 
false );
 
  202    mCrsGroupBox->setEnabled( 
false );
 
  203    mCrsGroupBox->setVisible( 
false );
 
  207  QVBoxLayout *actionLayout = 
new QVBoxLayout( actionOptionsFrame );
 
  208  actionLayout->setContentsMargins( 0, 0, 0, 0 );
 
  210  mActionDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  211  actionLayout->addWidget( mActionDialog );
 
  214  mSourceFieldsPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  215  mSourceFieldsFrame->setLayout( 
new QVBoxLayout( mSourceFieldsFrame ) );
 
  216  mSourceFieldsFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  217  mSourceFieldsFrame->layout()->addWidget( mSourceFieldsPropertiesDialog );
 
  222  mAttributesFormPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  223  mAttributesFormFrame->setLayout( 
new QVBoxLayout( mAttributesFormFrame ) );
 
  224  mAttributesFormFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  225  mAttributesFormFrame->layout()->addWidget( mAttributesFormPropertiesDialog );
 
  228  QVBoxLayout *metadataLayout = 
new QVBoxLayout( metadataFrame );
 
  229  metadataLayout->setContentsMargins( 0, 0, 0, 0 );
 
  231  mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  233  metadataLayout->addWidget( mMetadataWidget );
 
  234  metadataFrame->setLayout( metadataLayout );
 
  236  QVBoxLayout *temporalLayout = 
new QVBoxLayout( temporalFrame );
 
  237  temporalLayout->setContentsMargins( 0, 0, 0, 0 );
 
  239  temporalLayout->addWidget( mTemporalWidget );
 
  243  mBtnMetadata = 
new QPushButton( tr( 
"Metadata" ), 
this );
 
  244  QMenu *menuMetadata = 
new QMenu( 
this );
 
  247  menuMetadata->addSeparator();
 
  251  buttonBox->addButton( 
mBtnMetadata, QDialogButtonBox::ResetRole );
 
  253  mSelectionColorButton->setAllowOpacity( 
true );
 
  254  mSelectionColorButton->setColorDialogTitle( tr( 
"Override Selection Color" ) );
 
  260  connect( mRadioOverrideSelectionColor, &QRadioButton::toggled, mSelectionColorButton, &QWidget::setEnabled );
 
  261  mSelectionColorButton->setEnabled( 
false );
 
  262  connect( mRadioOverrideSelectionSymbol, &QRadioButton::toggled, mSelectionSymbolButton, &QWidget::setEnabled );
 
  280  mSelectionSymbolButton->setEnabled( 
false );
 
  281  mRadioDefaultSelectionColor->setChecked( 
true );
 
  291      pbnIndex->setEnabled( 
false );
 
  295      pbnIndex->setEnabled( 
false );
 
  296      pbnIndex->setText( tr( 
"Spatial Index Exists" ) );
 
  303      int encindex = cboProviderEncoding->findText( enc );
 
  306        cboProviderEncoding->insertItem( 0, enc );
 
  309      cboProviderEncoding->setCurrentIndex( encindex );
 
  311    else if ( mLayer->
providerType() == QLatin1String( 
"ogr" ) )
 
  316      cboProviderEncoding->setEnabled( 
false );
 
  321      mDataSourceEncodingFrame->hide();
 
  325  mCrsSelector->setCrs( mLayer->
crs() );
 
  328  const QList< QgsVectorLayerJoinInfo > &joins = mLayer->
vectorJoins();
 
  331    addJoinToTreeWidget( join );
 
  336  QVBoxLayout *diagLayout = 
new QVBoxLayout( mDiagramFrame );
 
  337  diagLayout->setContentsMargins( 0, 0, 0, 0 );
 
  339  diagramPropertiesDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
 
  341  diagLayout->addWidget( diagramPropertiesDialog );
 
  342  mDiagramFrame->setLayout( diagLayout );
 
  345  mLegendWidget->setMapCanvas( 
mCanvas );
 
  346  mLegendWidget->setLayer( mLayer );
 
  347  mLegendConfigEmbeddedWidget->setLayer( mLayer );
 
  353  mLayerShortNameLineEdit->setValidator( shortNameValidator );
 
  360  mLayerDataUrlFormatComboBox->setCurrentIndex(
 
  361    mLayerDataUrlFormatComboBox->findText(
 
  370  tableViewMetadataUrl->setSelectionMode( QAbstractItemView::SingleSelection );
 
  371  tableViewMetadataUrl->setSelectionBehavior( QAbstractItemView::SelectRows );
 
  372  tableViewMetadataUrl->horizontalHeader()->setStretchLastSection( 
true );
 
  373  tableViewMetadataUrl->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
 
  375  mMetadataUrlModel = 
new QStandardItemModel( tableViewMetadataUrl );
 
  376  mMetadataUrlModel->clear();
 
  377  mMetadataUrlModel->setColumnCount( 3 );
 
  378  QStringList metadataUrlHeaders;
 
  379  metadataUrlHeaders << tr( 
"URL" ) << tr( 
"Type" ) << tr( 
"Format" );
 
  380  mMetadataUrlModel->setHorizontalHeaderLabels( metadataUrlHeaders );
 
  381  tableViewMetadataUrl->setModel( mMetadataUrlModel );
 
  382  tableViewMetadataUrl->setItemDelegate( 
new MetadataUrlItemDelegate( 
this ) );
 
  387    const int row = mMetadataUrlModel->rowCount();
 
  388    mMetadataUrlModel->setItem( row, 0, 
new QStandardItem( metaUrl.url ) );
 
  389    mMetadataUrlModel->setItem( row, 1, 
new QStandardItem( metaUrl.type ) );
 
  390    mMetadataUrlModel->setItem( row, 2, 
new QStandardItem( metaUrl.format ) );
 
  394  mLayerLegendUrlLineEdit->setText( mLayer->
legendUrl() );
 
  395  mLayerLegendUrlFormatComboBox->setCurrentIndex(
 
  396    mLayerLegendUrlFormatComboBox->findText(
 
  403  const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &wmsDims = serverProperties->
wmsDimensions();
 
  406    addWmsDimensionInfoToTreeWidget( dim );
 
  410  myStyle.append( QStringLiteral( 
"body { margin: 10px; }\n " ) );
 
  411  teMetadataViewer->clear();
 
  412  teMetadataViewer->document()->setDefaultStyleSheet( myStyle );
 
  413  teMetadataViewer->setHtml( htmlMetadata() );
 
  414  teMetadataViewer->setOpenLinks( 
false );
 
  416  mMetadataFilled = 
true;
 
  421  if ( !settings.
contains( QStringLiteral( 
"/Windows/VectorLayerProperties/tab" ) ) )
 
  423    settings.
setValue( QStringLiteral( 
"Windows/VectorLayerProperties/tab" ),
 
  427  QList<QgsMapLayer *> dependencySources;
 
  428  const QSet<QgsMapLayerDependency> constDependencies = mLayer->
dependencies();
 
  433      dependencySources << layer;
 
  439  connect( 
QgsProject::instance(), &QObject::destroyed, 
this, [ = ] {mLayersDependenciesTreeView->setModel( 
nullptr );} );
 
  440  mLayersDependenciesTreeView->setModel( mLayersDependenciesTreeModel );
 
  442  mRefreshSettingsWidget->setLayer( mLayer );
 
  445  QMenu *menu = 
new QMenu( 
this );
 
  447  mAuxiliaryLayerActionNew = 
new QAction( tr( 
"Create" ), 
this );
 
  448  menu->addAction( mAuxiliaryLayerActionNew );
 
  449  connect( mAuxiliaryLayerActionNew, &QAction::triggered, 
this, &QgsVectorLayerProperties::onAuxiliaryLayerNew );
 
  451  mAuxiliaryLayerActionClear = 
new QAction( tr( 
"Clear" ), 
this );
 
  452  menu->addAction( mAuxiliaryLayerActionClear );
 
  453  connect( mAuxiliaryLayerActionClear, &QAction::triggered, 
this, &QgsVectorLayerProperties::onAuxiliaryLayerClear );
 
  455  mAuxiliaryLayerActionDelete = 
new QAction( tr( 
"Delete" ), 
this );
 
  456  menu->addAction( mAuxiliaryLayerActionDelete );
 
  457  connect( mAuxiliaryLayerActionDelete, &QAction::triggered, 
this, &QgsVectorLayerProperties::onAuxiliaryLayerDelete );
 
  459  mAuxiliaryLayerActionExport = 
new QAction( tr( 
"Export" ), 
this );
 
  460  menu->addAction( mAuxiliaryLayerActionExport );
 
  463  mAuxiliaryStorageActions->setMenu( menu );
 
  465  connect( mAuxiliaryStorageFieldsDeleteBtn, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::onAuxiliaryLayerDeleteField );
 
  466  connect( mAuxiliaryStorageFieldsAddBtn, &QPushButton::clicked, 
this, &QgsVectorLayerProperties::onAuxiliaryLayerAddField );
 
  468  updateAuxiliaryStoragePage();
 
  470  mOptsPage_Information->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#information-properties" ) );
 
  471  mOptsPage_Source->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#source-properties" ) );
 
  472  mOptsPage_Style->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#symbology-properties" ) );
 
  473  mOptsPage_Labels->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#labels-properties" ) );
 
  474  mOptsPage_Masks->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#masks-properties" ) );
 
  475  mOptsPage_Diagrams->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#diagrams-properties" ) );
 
  476  mOptsPage_SourceFields->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#fields-properties" ) );
 
  477  mOptsPage_AttributesForm->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#attributes-form-properties" ) );
 
  478  mOptsPage_Joins->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#joins-properties" ) );
 
  479  mOptsPage_AuxiliaryStorage->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#auxiliary-storage-properties" ) );
 
  480  mOptsPage_Actions->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#actions-properties" ) );
 
  481  mOptsPage_Display->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#display-properties" ) );
 
  482  mOptsPage_Rendering->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#rendering-properties" ) );
 
  483  mOptsPage_Temporal->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#temporal-properties" ) );
 
  484  mOptsPage_Variables->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#variables-properties" ) );
 
  485  mOptsPage_Metadata->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#metadata-properties" ) );
 
  486  mOptsPage_DataDependencies->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#dependencies-properties" ) ) ;
 
  487  mOptsPage_Legend->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#legend-properties" ) );
 
  488  mOptsPage_Server->setProperty( 
"helpPage", QStringLiteral( 
"working_with_vector/vector_properties.html#qgis-server-properties" ) );
 
 
  496void QgsVectorLayerProperties::toggleEditing()
 
  501  emit toggleEditing( mLayer );
 
  503  setPbnQueryBuilderEnabled();
 
  506void QgsVectorLayerProperties::insertField()
 
  510  if ( mMapTipFieldComboBox->currentField().isEmpty() )
 
  512  QString expression = QStringLiteral( 
"[%\"" );
 
  513  expression += mMapTipFieldComboBox->currentField();
 
  514  expression += QLatin1String( 
"\"%]" );
 
  516  mMapTipWidget->insertText( expression );
 
  519void QgsVectorLayerProperties::insertOrEditExpression()
 
  522  int selectionStart = mMapTipWidget->selectionStart();
 
  523  int selectionEnd = mMapTipWidget->selectionEnd();
 
  529  exprDlg.setWindowTitle( tr( 
"Insert Expression" ) );
 
  530  if ( exprDlg.exec() == QDialog::Accepted && !exprDlg.expressionText().trimmed().isEmpty() )
 
  531    mMapTipWidget->insertText( 
"[%" + exprDlg.expressionText().trimmed() + 
"%]" );
 
  533    mMapTipWidget->setLinearSelection( selectionStart, selectionEnd );
 
  536void QgsVectorLayerProperties::addMetadataUrl()
 
  538  const int row = mMetadataUrlModel->rowCount();
 
  539  mMetadataUrlModel->setItem( row, 0, 
new QStandardItem( QLatin1String() ) );
 
  540  mMetadataUrlModel->setItem( row, 1, 
new QStandardItem( QLatin1String() ) );
 
  541  mMetadataUrlModel->setItem( row, 2, 
new QStandardItem( QLatin1String() ) );
 
  544void QgsVectorLayerProperties::removeSelectedMetadataUrl()
 
  546  const QModelIndexList selectedRows = tableViewMetadataUrl->selectionModel()->selectedRows();
 
  547  if ( selectedRows.empty() )
 
  549  mMetadataUrlModel->removeRow( selectedRows[0].row() );
 
  554  if ( !mSourceWidget )
 
  559      QHBoxLayout *layout = 
new QHBoxLayout();
 
  560      layout->addWidget( mSourceWidget );
 
  561      mSourceGroupBox->setLayout( layout );
 
  563        mSourceGroupBox->setTitle( mSourceWidget->
groupTitle() );
 
  565      mSourceGroupBox->show();
 
  569        buttonBox->button( QDialogButtonBox::Apply )->setEnabled( isValid );
 
  570        buttonBox->button( QDialogButtonBox::Ok )->setEnabled( isValid );
 
  582  mLayerOrigNameLineEdit->setText( mLayer->
name() );
 
  583  mBackupCrs = mLayer->
crs();
 
  586  mSubsetGroupBox->setEnabled( 
true );
 
  593  txtSubsetSQL->setReadOnly( 
true );
 
  594  txtSubsetSQL->setCaretWidth( 0 );
 
  595  txtSubsetSQL->setCaretLineVisible( 
false );
 
  596  setPbnQueryBuilderEnabled();
 
  600    mSubsetGroupBox->hide();
 
  610  mScaleRangeWidget->setMapCanvas( 
mCanvas );
 
  613  mReferenceScaleWidget->setShowCurrentScaleButton( 
true );
 
  614  mReferenceScaleWidget->setMapCanvas( 
mCanvas );
 
  615  if ( mUseReferenceScaleGroupBox->isChecked() )
 
  623  mSimplifyDrawingSpinBox->setValue( simplifyMethod.
threshold() );
 
  624  mSimplifyDrawingSpinBox->setClearValue( 1.0 );
 
  629    mSelectionColorButton->setColor( selectionProperties->
selectionColor() );
 
  633    mSelectionSymbolButton->setSymbol( symbol->clone() );
 
  638      mRadioDefaultSelectionColor->setChecked( 
true );
 
  645        mRadioOverrideSelectionColor->setChecked( 
true );
 
  649        mRadioDefaultSelectionColor->setChecked( 
true );
 
  657        mRadioOverrideSelectionSymbol->setChecked( 
true );
 
  661        mRadioDefaultSelectionColor->setChecked( 
true );
 
  666  QString remark = QStringLiteral( 
" (%1)" ).arg( tr( 
"Not supported" ) );
 
  670    mSimplifyDrawingAtProvider->setChecked( 
false );
 
  671    mSimplifyDrawingAtProvider->setEnabled( 
false );
 
  672    if ( !mSimplifyDrawingAtProvider->text().endsWith( remark ) )
 
  673      mSimplifyDrawingAtProvider->setText( mSimplifyDrawingAtProvider->text().append( remark ) );
 
  678    mSimplifyDrawingAtProvider->setEnabled( mSimplifyDrawingGroupBox->isChecked() );
 
  679    if ( mSimplifyDrawingAtProvider->text().endsWith( remark ) )
 
  681      QString newText = mSimplifyDrawingAtProvider->text();
 
  682      newText.chop( remark.size() );
 
  683      mSimplifyDrawingAtProvider->setText( newText );
 
  690    mSimplifyDrawingGroupBox->setChecked( 
false );
 
  691    mSimplifyDrawingGroupBox->setEnabled( 
false );
 
  698  mSimplifyAlgorithmComboBox->setCurrentIndex( mSimplifyAlgorithmComboBox->findData( QVariant::fromValue( simplifyMethod.
simplifyAlgorithm() ) ) );
 
  701  myScalesList.append( QStringLiteral( 
"1:1" ) );
 
  702  mSimplifyMaximumScaleComboBox->updateScales( myScalesList );
 
  703  mSimplifyMaximumScaleComboBox->setScale( simplifyMethod.
maximumScale() );
 
  707  mRefreshSettingsWidget->syncToLayer();
 
  715  updateSymbologyPage();
 
  719  if ( labelingDialog )
 
  722  mSourceFieldsPropertiesDialog->
init();
 
  723  mAttributesFormPropertiesDialog->
init();
 
  726  updateVariableEditor();
 
  728  if ( diagramPropertiesDialog )
 
  734    page->syncToLayer( mLayer );
 
  741  mLegendWidget->setLayer( mLayer );
 
 
  747  if ( labelingDialog )
 
  751  mBackupCrs = mLayer->
crs();
 
  753  mLegendWidget->applyToLayer();
 
  754  mLegendConfigEmbeddedWidget->applyToLayer();
 
  758  mMetadataFilled = 
false;
 
  761  if ( mMaskingWidget )
 
  762    mMaskingWidget->apply();
 
  783  const auto constActions = mActionDialog->
actions();
 
  784  for ( 
const QgsAction &action : constActions )
 
  791  QVector<QgsAttributeTableConfig::ColumnConfig> columns = attributeTableConfig.
columns();
 
  793  for ( 
int i = 0; i < columns.size(); ++i )
 
  805  mLayer->
setName( mLayerOrigNameLineEdit->text() );
 
  807  mAttributesFormPropertiesDialog->
apply();
 
  808  mSourceFieldsPropertiesDialog->
apply();
 
  820  diagramPropertiesDialog->
apply();
 
  830    mMetadataFilled = 
false;
 
  834    mMetadataFilled = 
false;
 
  838    mMetadataFilled = 
false;
 
  842    mMetadataFilled = 
false;
 
  846    mMetadataFilled = 
false;
 
  850    mMetadataFilled = 
false;
 
  855    mMetadataFilled = 
false;
 
  859    mMetadataFilled = 
false;
 
  863  QList<QgsMapLayerServerProperties::MetadataUrl> metaUrls;
 
  864  for ( 
int row = 0; row < mMetadataUrlModel->rowCount() ; row++ )
 
  867    metaUrl.
url = mMetadataUrlModel->item( row, 0 )->text();
 
  868    metaUrl.
type = mMetadataUrlModel->item( row, 1 )->text();
 
  869    metaUrl.
format = mMetadataUrlModel->item( row, 2 )->text();
 
  870    metaUrls.append( metaUrl );
 
  871    mMetadataFilled = 
false;
 
  876  if ( mLayer->
legendUrl() != mLayerLegendUrlLineEdit->text() )
 
  877    mMetadataFilled = 
false;
 
  878  mLayer->
setLegendUrl( mLayerLegendUrlLineEdit->text() );
 
  880  if ( mLayer->
legendUrlFormat() != mLayerLegendUrlFormatComboBox->currentText() )
 
  881    mMetadataFilled = 
false;
 
  886  if ( mSimplifyDrawingGroupBox->isChecked() )
 
  889    if ( mSimplifyDrawingSpinBox->value() > 1 )
 
  895  simplifyMethod.
setThreshold( mSimplifyDrawingSpinBox->value() );
 
  897  simplifyMethod.
setMaximumScale( mSimplifyMaximumScaleComboBox->scale() );
 
  907  if ( mSelectionColorButton->color() != mSelectionColorButton->defaultColor() )
 
  911  if ( 
QgsSymbol *symbol = mSelectionSymbolButton->symbol() )
 
  914  if ( mRadioOverrideSelectionSymbol->isChecked() )
 
  918  else if ( mRadioOverrideSelectionColor->isChecked() )
 
  927  mRefreshSettingsWidget->saveToLayer();
 
  930  mLayer->
setRefreshOnNofifyMessage( mNotificationMessageCheckBox->isChecked() ? mNotifyMessagValueLineEdit->text() : QString() );
 
  936  updateVariableEditor();
 
  939  QSet<QgsMapLayerDependency> deps;
 
  940  const auto checkedLayers = mLayersDependenciesTreeModel->
checkedLayers();
 
  945    QMessageBox::warning( 
nullptr, tr( 
"Save Dependency" ), tr( 
"This configuration introduces a cycle in data dependencies and will be ignored." ) );
 
  954  bool dialogNeedsResync = 
false;
 
  957    const QString newSource = mSourceWidget->
sourceUri();
 
  958    if ( newSource != mLayer->
source() )
 
  966      dialogNeedsResync = 
true;
 
  972  mSubsetGroupBox->setEnabled( 
true );
 
  977    mMetadataFilled = 
false;
 
  979    dialogNeedsResync = 
true;
 
  983  if ( dialogNeedsResync )
 
  988  mProjectDirtyBlocker.reset();
 
 
 1001    const auto constVectorJoins = mLayer->
vectorJoins();
 
 1023  if ( backupCrs != mLayer->
crs() )
 
 1024    mLayer->
setCrs( backupCrs );
 
 
 1028void QgsVectorLayerProperties::pbnQueryBuilder_clicked()
 
 1037  if ( dialog->exec() )
 
 1051void QgsVectorLayerProperties::pbnIndex_clicked()
 
 1056    setCursor( Qt::WaitCursor );
 
 1058    setCursor( Qt::ArrowCursor );
 
 1061      pbnIndex->setEnabled( 
false );
 
 1062      pbnIndex->setText( tr( 
"Spatial Index Exists" ) );
 
 1063      QMessageBox::information( 
this, tr( 
"Spatial Index" ), tr( 
"Creation of spatial index successful" ) );
 
 1067      QMessageBox::warning( 
this, tr( 
"Spatial Index" ), tr( 
"Creation of spatial index failed" ) );
 
 1072QString QgsVectorLayerProperties::htmlMetadata()
 
 1082  mMetadataFilled = 
false;
 
 1086void QgsVectorLayerProperties::saveMultipleStylesAs()
 
 1089  dlg.setSaveOnlyCurrentStyle( 
false );
 
 1098    const QListWidget *stylesWidget { dlg.stylesWidget() };
 
 1101    QStringList stylesSelected;
 
 1102    for ( 
int i = 0; i < stylesWidget->count(); i++ )
 
 1104      if ( stylesWidget->item( i )->checkState() == Qt::CheckState::Checked )
 
 1106        stylesSelected.push_back( stylesWidget->item( i )->text() );
 
 1110    if ( ! stylesSelected.isEmpty() )
 
 1113      for ( 
const QString &styleName : std::as_const( stylesSelected ) )
 
 1115        bool defaultLoadedFlag = 
false;
 
 1117        StyleType type = dlg.currentStyleType();
 
 1125            const QString filePath { dlg.outputFilePath() };
 
 1126            const QFileInfo fi { filePath };
 
 1127            QString safePath { QString( filePath ).replace( fi.baseName(),
 
 1129            if ( styleIndex > 0 && stylesSelected.count( ) > 1 )
 
 1132              while ( QFile::exists( safePath ) )
 
 1134                const QFileInfo fi { safePath };
 
 1135                safePath = QString( safePath ).replace( 
'.' + fi.completeSuffix(),
 
 1136                                                        QStringLiteral( 
"_%1.%2" ).arg( QString::number( i ), fi.completeSuffix() ) );
 
 1141              message = mLayer->
saveNamedStyle( safePath, defaultLoadedFlag, dlg.styleCategories() );
 
 1143              message = mLayer->
saveSldStyle( safePath, defaultLoadedFlag );
 
 1146            if ( defaultLoadedFlag )
 
 1153              QMessageBox::information( 
this, tr( 
"Save Style" ), message );
 
 1160            QString infoWindowTitle = QObject::tr( 
"Save style '%1' to DB (%2)" )
 
 1167            QString name { dbSettings.
name };
 
 1168            if ( name.isEmpty() )
 
 1174              name += QStringLiteral( 
"_%1" ).arg( styleName );
 
 1175              QStringList ids, names, descriptions;
 
 1178              while ( names.contains( name ) )
 
 1180                name = QStringLiteral( 
"%1 %2" ).arg( name, QString::number( i ) );
 
 1185            QString errorMessage;
 
 1188              if ( QMessageBox::question( 
nullptr, QObject::tr( 
"Save style in database" ),
 
 1189                                          QObject::tr( 
"A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
 
 1190                                          QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
 
 1195            else if ( !errorMessage.isEmpty() )
 
 1197              QMessageBox::warning( 
this, infoWindowTitle, errorMessage );
 
 1203            if ( !msgError.isNull() )
 
 1205              QMessageBox::warning( 
this, infoWindowTitle, msgError );
 
 1209              QMessageBox::information( 
this, infoWindowTitle, tr( 
"Style '%1' saved" ).arg( styleName ) );
 
 1224void QgsVectorLayerProperties::aboutToShowStyleMenu()
 
 1227  QMenu *m = qobject_cast<QMenu *>( sender() );
 
 1230  m->addAction( mActionLoadStyle );
 
 1231  m->addAction( mActionSaveStyle );
 
 1236    mActionSaveStyle->setText( tr( 
"Save Current Style…" ) );
 
 1237    m->addAction( mActionSaveMultipleStyles );
 
 1241    mActionSaveStyle->setText( tr( 
"Save Style…" ) );
 
 1253void QgsVectorLayerProperties::mButtonAddJoin_clicked()
 
 1258  QList<QgsMapLayer *> joinedLayers;
 
 1259  const QList< QgsVectorLayerJoinInfo > &joins = mLayer->
vectorJoins();
 
 1260  joinedLayers.reserve( joins.size() );
 
 1261  for ( 
int i = 0; i < joins.size(); ++i )
 
 1263    joinedLayers.append( joins[i].joinLayer() );
 
 1267  if ( d.exec() == QDialog::Accepted )
 
 1271    if ( d.createAttributeIndex() )
 
 1280    addJoinToTreeWidget( info );
 
 1281    setPbnQueryBuilderEnabled();
 
 1282    mSourceFieldsPropertiesDialog->
init();
 
 1283    mAttributesFormPropertiesDialog->
init();
 
 1287void QgsVectorLayerProperties::mButtonEditJoin_clicked()
 
 1289  QTreeWidgetItem *currentJoinItem = mJoinTreeWidget->currentItem();
 
 1290  mJoinTreeWidget_itemDoubleClicked( currentJoinItem, 0 );
 
 1293void QgsVectorLayerProperties::mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, 
int )
 
 1295  if ( !mLayer || !item )
 
 1300  QList<QgsMapLayer *> joinedLayers;
 
 1301  QString joinLayerId = item->data( 0, Qt::UserRole ).toString();
 
 1302  const QList< QgsVectorLayerJoinInfo > &joins = mLayer->
vectorJoins();
 
 1304  for ( 
int i = 0; i < joins.size(); ++i )
 
 1310    if ( joinLayer->
id() == joinLayerId )
 
 1317      joinedLayers.append( joinLayer );
 
 1326  d.setWindowTitle( tr( 
"Edit Vector Join" ) );
 
 1327  d.setJoinInfo( joins[j] );
 
 1329  if ( d.exec() == QDialog::Accepted )
 
 1335    int idx = mJoinTreeWidget->indexOfTopLevelItem( item );
 
 1336    mJoinTreeWidget->takeTopLevelItem( idx );
 
 1341    if ( d.createAttributeIndex() )
 
 1350    addJoinToTreeWidget( info, idx );
 
 1352    setPbnQueryBuilderEnabled();
 
 1353    mSourceFieldsPropertiesDialog->
init();
 
 1354    mAttributesFormPropertiesDialog->
init();
 
 1358void QgsVectorLayerProperties::addJoinToTreeWidget( 
const QgsVectorLayerJoinInfo &join, 
const int insertIndex )
 
 1360  QTreeWidgetItem *joinItem = 
new QTreeWidgetItem();
 
 1361  joinItem->setFlags( Qt::ItemIsEnabled );
 
 1364  if ( !mLayer || !joinLayer )
 
 1369  joinItem->setText( 0, tr( 
"Join layer" ) );
 
 1375  joinItem->setText( 1, joinLayer->
name() );
 
 1377  QFont f = joinItem->font( 0 );
 
 1379  joinItem->setFont( 0, f );
 
 1380  joinItem->setFont( 1, f );
 
 1382  joinItem->setData( 0, Qt::UserRole, join.
joinLayerId() );
 
 1384  QTreeWidgetItem *childJoinField = 
new QTreeWidgetItem();
 
 1385  childJoinField->setText( 0, tr( 
"Join field" ) );
 
 1387  childJoinField->setFlags( Qt::ItemIsEnabled );
 
 1388  joinItem->addChild( childJoinField );
 
 1390  QTreeWidgetItem *childTargetField = 
new QTreeWidgetItem();
 
 1391  childTargetField->setText( 0, tr( 
"Target field" ) );
 
 1393  joinItem->addChild( childTargetField );
 
 1395  QTreeWidgetItem *childMemCache = 
new QTreeWidgetItem();
 
 1396  childMemCache->setText( 0, tr( 
"Cache join layer in virtual memory" ) );
 
 1398    childMemCache->setText( 1, QChar( 0x2714 ) );
 
 1399  joinItem->addChild( childMemCache );
 
 1401  QTreeWidgetItem *childDynForm = 
new QTreeWidgetItem();
 
 1402  childDynForm->setText( 0, tr( 
"Dynamic form" ) );
 
 1404    childDynForm->setText( 1, QChar( 0x2714 ) );
 
 1405  joinItem->addChild( childDynForm );
 
 1407  QTreeWidgetItem *childEditable = 
new QTreeWidgetItem();
 
 1408  childEditable->setText( 0, tr( 
"Editable join layer" ) );
 
 1410    childEditable->setText( 1, QChar( 0x2714 ) );
 
 1411  joinItem->addChild( childEditable );
 
 1413  QTreeWidgetItem *childUpsert = 
new QTreeWidgetItem();
 
 1414  childUpsert->setText( 0, tr( 
"Upsert on edit" ) );
 
 1416    childUpsert->setText( 1, QChar( 0x2714 ) );
 
 1417  joinItem->addChild( childUpsert );
 
 1419  QTreeWidgetItem *childCascade = 
new QTreeWidgetItem();
 
 1420  childCascade->setText( 0, tr( 
"Delete cascade" ) );
 
 1422    childCascade->setText( 1, QChar( 0x2714 ) );
 
 1423  joinItem->addChild( childCascade );
 
 1425  QTreeWidgetItem *childPrefix = 
new QTreeWidgetItem();
 
 1426  childPrefix->setText( 0, tr( 
"Custom field name prefix" ) );
 
 1427  childPrefix->setText( 1, join.
prefix() );
 
 1428  joinItem->addChild( childPrefix );
 
 1430  QTreeWidgetItem *childFields = 
new QTreeWidgetItem();
 
 1431  childFields->setText( 0, tr( 
"Joined fields" ) );
 
 1434    childFields->setText( 1, QLocale().toString( list->count() ) );
 
 1436    childFields->setText( 1, tr( 
"all" ) );
 
 1437  joinItem->addChild( childFields );
 
 1439  if ( insertIndex >= 0 )
 
 1440    mJoinTreeWidget->insertTopLevelItem( insertIndex, joinItem );
 
 1442    mJoinTreeWidget->addTopLevelItem( joinItem );
 
 1444  mJoinTreeWidget->setCurrentItem( joinItem );
 
 1445  mJoinTreeWidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
 
 1455  QDialog *dlg = 
new QDialog();
 
 1456  QString key = QStringLiteral( 
"/UI/paneldialog/%1" ).arg( panel->
panelTitle() );
 
 1458  dlg->restoreGeometry( settings.
value( key ).toByteArray() );
 
 1460  dlg->setLayout( 
new QVBoxLayout() );
 
 1461  dlg->layout()->addWidget( panel );
 
 1462  QDialogButtonBox *buttonBox = 
new QDialogButtonBox( QDialogButtonBox::Ok );
 
 1463  connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
 
 1464  dlg->layout()->addWidget( buttonBox );
 
 1466  settings.
setValue( key, dlg->saveGeometry() );
 
 1470void QgsVectorLayerProperties::mButtonRemoveJoin_clicked()
 
 1472  QTreeWidgetItem *currentJoinItem = mJoinTreeWidget->currentItem();
 
 1473  if ( !mLayer || !currentJoinItem )
 
 1478  mLayer->
removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );
 
 1479  mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
 
 1480  setPbnQueryBuilderEnabled();
 
 1481  mSourceFieldsPropertiesDialog->
init();
 
 1482  mAttributesFormPropertiesDialog->
init();
 
 1486void QgsVectorLayerProperties::mButtonAddWmsDimension_clicked()
 
 1492  QStringList alreadyDefinedDimensions;
 
 1494  const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &dims = serverProperties->
wmsDimensions();
 
 1497    alreadyDefinedDimensions << dim.name;
 
 1501  if ( d.exec() == QDialog::Accepted )
 
 1506    addWmsDimensionInfoToTreeWidget( info );
 
 1510void QgsVectorLayerProperties::mButtonEditWmsDimension_clicked()
 
 1512  QTreeWidgetItem *currentWmsDimensionItem = mWmsDimensionsTreeWidget->currentItem();
 
 1513  mWmsDimensionsTreeWidget_itemDoubleClicked( currentWmsDimensionItem, 0 );
 
 1516void QgsVectorLayerProperties::mWmsDimensionsTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, 
int )
 
 1518  if ( !mLayer || !item )
 
 1523  QString wmsDimName = item->data( 0, Qt::UserRole ).toString();
 
 1525  const QList<QgsMapLayerServerProperties::WmsDimensionInfo> &dims = serverProperties->
wmsDimensions();
 
 1526  QStringList alreadyDefinedDimensions;
 
 1528  for ( 
int i = 0; i < dims.size(); ++i )
 
 1530    QString dimName = dims[i].name;
 
 1531    if ( dimName == wmsDimName )
 
 1537      alreadyDefinedDimensions << dimName;
 
 1546  d.setWindowTitle( tr( 
"Edit WMS Dimension" ) );
 
 1547  d.setInfo( dims[j] );
 
 1549  if ( d.exec() == QDialog::Accepted )
 
 1556    int idx = mWmsDimensionsTreeWidget->indexOfTopLevelItem( item );
 
 1557    mWmsDimensionsTreeWidget->takeTopLevelItem( idx );
 
 1561    addWmsDimensionInfoToTreeWidget( info, idx );
 
 1567  QTreeWidgetItem *wmsDimensionItem = 
new QTreeWidgetItem();
 
 1568  wmsDimensionItem->setFlags( Qt::ItemIsEnabled );
 
 1570  wmsDimensionItem->setText( 0, tr( 
"Dimension" ) );
 
 1571  wmsDimensionItem->setText( 1, wmsDim.
name );
 
 1573  QFont f = wmsDimensionItem->font( 0 );
 
 1575  wmsDimensionItem->setFont( 0, f );
 
 1576  wmsDimensionItem->setFont( 1, f );
 
 1578  wmsDimensionItem->setData( 0, Qt::UserRole, wmsDim.
name );
 
 1580  QTreeWidgetItem *childWmsDimensionField = 
new QTreeWidgetItem();
 
 1581  childWmsDimensionField->setText( 0, tr( 
"Field" ) );
 
 1582  childWmsDimensionField->setText( 1, wmsDim.
fieldName );
 
 1583  childWmsDimensionField->setFlags( Qt::ItemIsEnabled );
 
 1584  wmsDimensionItem->addChild( childWmsDimensionField );
 
 1586  QTreeWidgetItem *childWmsDimensionEndField = 
new QTreeWidgetItem();
 
 1587  childWmsDimensionEndField->setText( 0, tr( 
"End field" ) );
 
 1588  childWmsDimensionEndField->setText( 1, wmsDim.
endFieldName );
 
 1589  childWmsDimensionEndField->setFlags( Qt::ItemIsEnabled );
 
 1590  wmsDimensionItem->addChild( childWmsDimensionEndField );
 
 1592  QTreeWidgetItem *childWmsDimensionUnits = 
new QTreeWidgetItem();
 
 1593  childWmsDimensionUnits->setText( 0, tr( 
"Units" ) );
 
 1594  childWmsDimensionUnits->setText( 1, wmsDim.
units );
 
 1595  childWmsDimensionUnits->setFlags( Qt::ItemIsEnabled );
 
 1596  wmsDimensionItem->addChild( childWmsDimensionUnits );
 
 1598  QTreeWidgetItem *childWmsDimensionUnitSymbol = 
new QTreeWidgetItem();
 
 1599  childWmsDimensionUnitSymbol->setText( 0, tr( 
"Unit symbol" ) );
 
 1600  childWmsDimensionUnitSymbol->setText( 1, wmsDim.
unitSymbol );
 
 1601  childWmsDimensionUnitSymbol->setFlags( Qt::ItemIsEnabled );
 
 1602  wmsDimensionItem->addChild( childWmsDimensionUnitSymbol );
 
 1604  QTreeWidgetItem *childWmsDimensionDefaultValue = 
new QTreeWidgetItem();
 
 1605  childWmsDimensionDefaultValue->setText( 0, tr( 
"Default display" ) );
 
 1607  childWmsDimensionDefaultValue->setFlags( Qt::ItemIsEnabled );
 
 1608  wmsDimensionItem->addChild( childWmsDimensionDefaultValue );
 
 1610  QTreeWidgetItem *childWmsDimensionRefValue = 
new QTreeWidgetItem();
 
 1611  childWmsDimensionRefValue->setText( 0, tr( 
"Reference value" ) );
 
 1612  childWmsDimensionRefValue->setText( 1, wmsDim.
referenceValue.toString() );
 
 1613  childWmsDimensionRefValue->setFlags( Qt::ItemIsEnabled );
 
 1614  wmsDimensionItem->addChild( childWmsDimensionRefValue );
 
 1616  if ( insertIndex >= 0 )
 
 1617    mWmsDimensionsTreeWidget->insertTopLevelItem( insertIndex, wmsDimensionItem );
 
 1619    mWmsDimensionsTreeWidget->addTopLevelItem( wmsDimensionItem );
 
 1621  mWmsDimensionsTreeWidget->setCurrentItem( wmsDimensionItem );
 
 1622  mWmsDimensionsTreeWidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
 
 1625void QgsVectorLayerProperties::mButtonRemoveWmsDimension_clicked()
 
 1627  QTreeWidgetItem *currentWmsDimensionItem = mWmsDimensionsTreeWidget->currentItem();
 
 1628  if ( !mLayer || !currentWmsDimensionItem )
 
 1634  serverProperties->
removeWmsDimension( currentWmsDimensionItem->data( 0, Qt::UserRole ).toString() );
 
 1635  mWmsDimensionsTreeWidget->takeTopLevelItem( mWmsDimensionsTreeWidget->indexOfTopLevelItem( currentWmsDimensionItem ) );
 
 1639void QgsVectorLayerProperties::updateSymbologyPage()
 
 1643  delete mRendererDialog;
 
 1644  mRendererDialog = 
nullptr;
 
 1660    mOptsPage_Style->setEnabled( 
false ); 
 
 1663  if ( mRendererDialog )
 
 1665    mRendererDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
 
 1666    widgetStackRenderers->addWidget( mRendererDialog );
 
 1667    widgetStackRenderers->setCurrentWidget( mRendererDialog );
 
 1668    widgetStackRenderers->currentWidget()->layout()->setContentsMargins( 0, 0, 0, 0 );
 
 1672void QgsVectorLayerProperties::setPbnQueryBuilderEnabled()
 
 1674  pbnQueryBuilder->setEnabled( mLayer &&
 
 1681    pbnQueryBuilder->setToolTip( tr( 
"Stop editing mode to enable this." ) );
 
 1686void QgsVectorLayerProperties::pbnUpdateExtents_clicked()
 
 1689  mMetadataFilled = 
false;
 
 1696  if ( index == 
mOptStackedWidget->indexOf( mOptsPage_Information ) && ! mMetadataFilled )
 
 1699    teMetadataViewer->clear();
 
 1700    teMetadataViewer->setHtml( htmlMetadata() );
 
 1701    mMetadataFilled = 
true;
 
 1706    mAttributesFormPropertiesDialog->
store();
 
 
 1712void QgsVectorLayerProperties::mSimplifyDrawingGroupBox_toggled( 
bool checked )
 
 1717    mSimplifyDrawingAtProvider->setEnabled( 
false );
 
 1721    mSimplifyDrawingAtProvider->setEnabled( checked );
 
 1725void QgsVectorLayerProperties::updateVariableEditor()
 
 1728  mVariableEditor->setContext( &context );
 
 1732  mVariableEditor->reloadContext();
 
 1733  mVariableEditor->setEditableScopeIndex( 2 );
 
 1736void QgsVectorLayerProperties::showHelp()
 
 1738  const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property( 
"helpPage" );
 
 1740  if ( helpPage.isValid() )
 
 1746    QgsHelp::openHelp( QStringLiteral( 
"working_with_vector/vector_properties.html" ) );
 
 1750void QgsVectorLayerProperties::updateAuxiliaryStoragePage()
 
 1757    mAuxiliaryStorageInformationGrpBox->setEnabled( 
true );
 
 1758    mAuxiliaryStorageFieldsGrpBox->setEnabled( 
true );
 
 1765    mAuxiliaryStorageFeaturesLineEdit->setText( QLocale().toString( features ) );
 
 1768    mAuxiliaryLayerActionClear->setEnabled( 
true );
 
 1769    mAuxiliaryLayerActionDelete->setEnabled( 
true );
 
 1770    mAuxiliaryLayerActionExport->setEnabled( 
true );
 
 1771    mAuxiliaryLayerActionNew->setEnabled( 
false );
 
 1777      mAuxiliaryStorageFieldsLineEdit->setText( QLocale().toString( fields ) );
 
 1780      mAuxiliaryStorageFieldsTree->clear();
 
 1781      for ( 
const QgsField &field : alayer->auxiliaryFields() )
 
 1784        QTreeWidgetItem *item = 
new QTreeWidgetItem();
 
 1786        item->setText( 0, prop.
origin() );
 
 1787        item->setText( 1, prop.
name() );
 
 1788        item->setText( 2, prop.
comment() );
 
 1789        item->setText( 3, field.typeName() );
 
 1790        item->setText( 4, field.name() );
 
 1792        mAuxiliaryStorageFieldsTree->addTopLevelItem( item );
 
 1798    mAuxiliaryStorageInformationGrpBox->setEnabled( 
false );
 
 1799    mAuxiliaryStorageFieldsGrpBox->setEnabled( 
false );
 
 1801    mAuxiliaryLayerActionClear->setEnabled( 
false );
 
 1802    mAuxiliaryLayerActionDelete->setEnabled( 
false );
 
 1803    mAuxiliaryLayerActionExport->setEnabled( 
false );
 
 1804    mAuxiliaryLayerActionNew->setEnabled( 
true );
 
 1806    mAuxiliaryStorageFieldsTree->clear();
 
 1807    mAuxiliaryStorageKeyLineEdit->setText( QString() );
 
 1808    mAuxiliaryStorageFieldsLineEdit->setText( QString() );
 
 1809    mAuxiliaryStorageFeaturesLineEdit->setText( QString() );
 
 1813void QgsVectorLayerProperties::onAuxiliaryLayerNew()
 
 1821  if ( dlg.exec() == QDialog::Accepted )
 
 1823    updateAuxiliaryStoragePage();
 
 1827void QgsVectorLayerProperties::onAuxiliaryLayerClear()
 
 1834  const QString msg = tr( 
"Are you sure you want to clear auxiliary data for %1?" ).arg( mLayer->
name() );
 
 1835  QMessageBox::StandardButton reply;
 
 1836  reply = QMessageBox::question( 
this, 
"Clear Auxiliary Data", msg, QMessageBox::Yes | QMessageBox::No );
 
 1838  if ( reply == QMessageBox::Yes )
 
 1840    QApplication::setOverrideCursor( Qt::WaitCursor );
 
 1842    QApplication::restoreOverrideCursor();
 
 1843    updateAuxiliaryStoragePage();
 
 1848void QgsVectorLayerProperties::onAuxiliaryLayerDelete()
 
 1854  const QString msg = tr( 
"Are you sure you want to delete auxiliary storage for %1?" ).arg( mLayer->
name() );
 
 1855  QMessageBox::StandardButton reply;
 
 1856  reply = QMessageBox::question( 
this, 
"Delete Auxiliary Storage", msg, QMessageBox::Yes | QMessageBox::No );
 
 1858  if ( reply == QMessageBox::Yes )
 
 1860    QApplication::setOverrideCursor( Qt::WaitCursor );
 
 1873    QApplication::restoreOverrideCursor();
 
 1874    updateAuxiliaryStoragePage();
 
 1879void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
 
 1885  QList<QTreeWidgetItem *> items = mAuxiliaryStorageFieldsTree->selectedItems();
 
 1886  if ( items.count() < 1 )
 
 1890  const QTreeWidgetItem *item = items[0];
 
 1893  def.
setName( item->text( 1 ) );
 
 1903  const QString msg = tr( 
"Are you sure you want to delete auxiliary field %1 for %2?" ).arg( item->text( 1 ), item->text( 0 ) );
 
 1905  QMessageBox::StandardButton reply;
 
 1906  const QString title = QObject::tr( 
"Delete Auxiliary Field" );
 
 1907  reply = QMessageBox::question( 
this, title, msg, QMessageBox::Yes | QMessageBox::No );
 
 1909  if ( reply == QMessageBox::Yes )
 
 1911    QApplication::setOverrideCursor( Qt::WaitCursor );
 
 1912    deleteAuxiliaryField( index );
 
 1914    QApplication::restoreOverrideCursor();
 
 1918void QgsVectorLayerProperties::onAuxiliaryLayerAddField()
 
 1925  if ( dlg.exec() == QDialog::Accepted )
 
 1927    updateAuxiliaryStoragePage();
 
 1931void QgsVectorLayerProperties::deleteAuxiliaryField( 
int index )
 
 1944    if ( key >= 0 && def.
origin().compare( 
"labeling", Qt::CaseInsensitive ) == 0
 
 1951    updateAuxiliaryStoragePage();
 
 1952    mSourceFieldsPropertiesDialog->
init();
 
 1956    const QString title = QObject::tr( 
"Delete Auxiliary Field" );
 
 1958    const QString msg = QObject::tr( 
"Unable to remove auxiliary field (%1)" ).arg( errors );
 
 1966  if ( obj == mMapTipPreviewContainer && ev->type() == QEvent::Resize )
 
 1970  return QgsOptionsDialogBase::eventFilter( obj, ev );
 
 
 1973void QgsVectorLayerProperties::initMapTipPreview()
 
 1976  mMapTipSplitter->setSizes( { 400, 200 } );
 
 1978  mMapTipPreviewContainer->installEventFilter( 
this );
 
 1982  mMapTipPreview = 
new QgsWebView( mMapTipPreviewContainer );
 
 1985  mMapTipPreview->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
 
 1986  mMapTipPreview->setContextMenuPolicy( Qt::NoContextMenu ); 
 
 1987  connect( mMapTipPreview, &QWebView::loadFinished, 
this, &QgsVectorLayerProperties::resizeMapTip );
 
 1990  mMapTipPreview->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, 
true );
 
 1991  mMapTipPreview->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled, 
true );
 
 1992  mMapTipPreview->page()->settings()->setAttribute( QWebSettings::LocalStorageEnabled, 
true );
 
 1995  mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
 
 1996  mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
 
 1999  connect( mMapTipWidget, &QgsCodeEditorHTML::textChanged, 
this, &QgsVectorLayerProperties::updateMapTipPreview );
 
 2003void QgsVectorLayerProperties::updateMapTipPreview()
 
 2005  mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
 
 2007  mMapTipPreview->setHtml( htmlContent );
 
 2010void QgsVectorLayerProperties::resizeMapTip()
 
 2013  mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
 
 2016  const QWebElement container = mMapTipPreview->page()->mainFrame()->findFirstElement(
 
 2017                                  QStringLiteral( 
"#QgsWebViewContainer" ) );
 
 2018  const int width = container.geometry().width();
 
 2019  const int height = container.geometry().height();
 
 2020  mMapTipPreview->resize( width, height );
 
 2023  mMapTipPreview->move( ( mMapTipPreviewContainer->width() - mMapTipPreview->width() ) / 2,
 
 2024                        ( mMapTipPreviewContainer->height() - mMapTipPreview->height() ) / 2 );
 
 2027  mMapTipPreview->adjustSize();
 
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.
 
@ 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).
 
QFlags< ReadFlag > ReadFlags
 
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.
 
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.
 
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 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 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.
 
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 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.
 
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.
 
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(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.
 
@ 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).
 
QFlags< Capability > 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.
 
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.
 
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.