QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgslayerpropertiesdialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslayerpropertiesdialog.cpp
3 --------------------------------------
4 Date : June 2023
5 Copyright : (C) 2023 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17
18#include "qgsfileutils.h"
19#include "qgsmapcanvas.h"
20#include "qgsmaplayer.h"
26#include "qgsmetadatawidget.h"
27#include "qgsnative.h"
28#include "qgsproviderregistry.h"
29#include "qgssettings.h"
30#include "qgssldexportcontext.h"
31
32#include <QDesktopServices>
33#include <QDir>
34#include <QFileDialog>
35#include <QMessageBox>
36#include <qstackedwidget.h>
37
38#include "moc_qgslayerpropertiesdialog.cpp"
39
40QgsLayerPropertiesDialog::QgsLayerPropertiesDialog( QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent, Qt::WindowFlags fl, QgsSettings *settings )
41 : QgsOptionsDialogBase( settingsKey, parent, fl, settings )
42 , mCanvas( canvas )
43 , mLayer( layer )
44{
45}
46
48{
49 mMetadataWidget = widget;
50 mMetadataPage = page;
51}
52
54{
55 if ( !mLayer || !mMetadataWidget )
56 return;
57
58 QgsSettings settings; // where we keep last used filter in persistent state
59 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
60
61 const QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Layer Metadata" ), lastUsedDir, tr( "QGIS Layer Metadata File" ) + " (*.qmd)" );
62 if ( fileName.isNull() )
63 {
64 return;
65 }
66
67 bool defaultLoadedFlag = false;
68 const QString message = mLayer->loadNamedMetadata( fileName, defaultLoadedFlag );
69
70 //reset if the default style was loaded OK only
71 if ( defaultLoadedFlag )
72 {
73 mMetadataWidget->setMetadata( &mLayer->metadata() );
74 }
75 else
76 {
77 //let the user know what went wrong
78 QMessageBox::warning( this, tr( "Load Metadata" ), message );
79 }
80
81 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( fileName ).path() );
82
84}
85
87{
88 if ( !mLayer || !mMetadataWidget )
89 return;
90
91 QgsSettings settings; // where we keep last used filter in persistent state
92 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
93
94 QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save Layer Metadata as QMD" ), lastUsedDir, tr( "QMD File" ) + " (*.qmd)" );
95 // return dialog focus on Mac
96 activateWindow();
97 raise();
98 if ( outputFileName.isEmpty() )
99 {
100 return;
101 }
102
103 mMetadataWidget->acceptMetadata();
104
105 //ensure the user never omitted the extension from the file name
106 if ( !outputFileName.endsWith( QgsMapLayer::extensionPropertyType( QgsMapLayer::Metadata ), Qt::CaseInsensitive ) )
107 {
109 }
110
111 bool defaultLoadedFlag = false;
112 const QString message = mLayer->saveNamedMetadata( outputFileName, defaultLoadedFlag );
113 if ( defaultLoadedFlag )
114 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
115 else
116 QMessageBox::information( this, tr( "Save Metadata" ), message );
117
119}
120
122{
123 if ( !mLayer || !mMetadataWidget )
124 return;
125
126 mMetadataWidget->acceptMetadata();
127
128 bool defaultSavedFlag = false;
129 const QString infoWindowTitle = QObject::tr( "Save Default Metadata" );
130 const QString errorMsg = mLayer->saveDefaultMetadata( defaultSavedFlag );
131 if ( !defaultSavedFlag )
132 {
133 QMessageBox::warning( this, infoWindowTitle, errorMsg );
135 }
136 else
137 {
138 QMessageBox::information( this, infoWindowTitle, tr( "Metadata saved." ) );
139 }
140}
141
143{
144 if ( !mLayer || !mMetadataWidget )
145 return;
146
147 bool defaultLoadedFlag = false;
148 const QString message = mLayer->loadNamedMetadata( mLayer->metadataUri(), defaultLoadedFlag );
149 //reset if the default metadata was loaded OK only
150 if ( defaultLoadedFlag )
151 {
152 mMetadataWidget->setMetadata( &mLayer->metadata() );
153 }
154 else
155 {
156 QMessageBox::information( this, tr( "Default Metadata" ), message );
158 }
159}
160
162{
163 if ( !mLayer )
164 return;
165
166 QgsSettings settings;
167 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
168
169 QString fileName = QFileDialog::getOpenFileName(
170 this,
171 tr( "Load layer properties from style file" ),
172 lastUsedDir,
173 tr( "QGIS Layer Style File" ) + " (*.qml)"
174 );
175 if ( fileName.isEmpty() )
176 return;
177
178 // ensure the user never omits the extension from the file name
179 if ( !fileName.endsWith( QLatin1String( ".qml" ), Qt::CaseInsensitive ) )
180 fileName += QLatin1String( ".qml" );
181
183
184 bool defaultLoadedFlag = false;
185 const QString message = mLayer->loadNamedStyle( fileName, defaultLoadedFlag );
186 if ( defaultLoadedFlag )
187 {
188 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( fileName ).absolutePath() );
189 syncToLayer();
190 }
191 else
192 {
193 QMessageBox::information( this, tr( "Load Style" ), message );
195 }
196}
197
199{
200 if ( !mLayer )
201 return;
202
203 QgsSettings settings;
204 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
205
206 QString outputFileName = QFileDialog::getSaveFileName(
207 this,
208 tr( "Save layer properties as style file" ),
209 lastUsedDir,
210 tr( "QGIS Layer Style File" ) + " (*.qml)"
211 );
212 // return dialog focus on Mac
213 activateWindow();
214 raise();
215 if ( outputFileName.isEmpty() )
216 return;
217
218 // ensure the user never omits the extension from the file name
219 outputFileName = QgsFileUtils::ensureFileNameHasExtension( outputFileName, QStringList() << QStringLiteral( "qml" ) );
220
221 apply(); // make sure the style to save is up-to-date
222
223 // then export style
224 bool defaultLoadedFlag = false;
225 const QString message = mLayer->saveNamedStyle( outputFileName, defaultLoadedFlag );
226
227 if ( defaultLoadedFlag )
228 {
229 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
230 }
231 else
232 {
233 QMessageBox::information( this, tr( "Save Style" ), message );
235 }
236}
237
239{
240 if ( !mLayer )
241 return;
242
243 apply(); // make sure the style to save is up-to-date
244
245 // a flag passed by reference
246 bool defaultSavedFlag = false;
247 // TODO Once the deprecated `saveDefaultStyle()` method is gone, just
248 // remove the NOWARN_DEPRECATED tags
250 // after calling this the above flag will be set true for success
251 // or false if the save operation failed
252 const QString message = mLayer->saveDefaultStyle( defaultSavedFlag );
254 if ( !defaultSavedFlag )
255 {
256 // let the user know what went wrong
257 QMessageBox::information( this, tr( "Default Style" ), message );
259 }
260}
261
263{
264 restoreOptionsBaseUi( generateDialogTitle() );
265}
266
268{
269 activateWindow(); // set focus back to properties dialog
270}
271
273{
274 if ( !factory->supportsLayer( mLayer ) || !factory->supportLayerPropertiesDialog() )
275 {
276 return;
277 }
278
279 QgsMapLayerConfigWidget *page = factory->createWidget( mLayer, mCanvas, false, this );
280 mConfigWidgets << page;
281
282 const QString beforePage = factory->layerPropertiesPagePositionHint();
283 if ( beforePage.isEmpty() )
284 addPage( factory->title(), factory->title(), factory->icon(), page );
285 else
286 insertPage( factory->title(), factory->title(), factory->icon(), page, beforePage );
287
288 page->syncToLayer( mLayer );
289}
290
292{
293 QString msg;
294 bool defaultLoadedFlag = false;
295
296 const QgsDataProvider *provider = mLayer->dataProvider();
297 if ( !provider )
298 return;
300 {
301 QMessageBox askToUser;
302 askToUser.setText( tr( "Load default style from: " ) );
303 askToUser.setIcon( QMessageBox::Question );
304 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
305 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
306 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
307
308 switch ( askToUser.exec() )
309 {
310 case 0:
311 return;
312 case 2:
313 msg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, false );
314 if ( !defaultLoadedFlag )
315 {
316 //something went wrong - let them know why
317 QMessageBox::information( this, tr( "Default Style" ), msg );
318 }
319 if ( msg.compare( tr( "Loaded from Provider" ) ) )
320 {
321 QMessageBox::information( this, tr( "Default Style" ), tr( "No default style was found for this layer." ) );
322 }
323 else
324 {
325 syncToLayer();
326 apply();
327 }
328
329 return;
330 default:
331 break;
332 }
333 }
334
335 QString myMessage = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true );
336 // QString myMessage = layer->loadDefaultStyle( defaultLoadedFlag );
337 //reset if the default style was loaded OK only
338 if ( defaultLoadedFlag )
339 {
340 // all worked OK so no need to inform user
341 syncToLayer();
342 apply();
343 }
344 else
345 {
346 //something went wrong - let them know why
347 QMessageBox::information( this, tr( "Default Style" ), myMessage );
348 }
349}
350
352{
353 QString errorMsg;
354 const QgsDataProvider *provider = mLayer->dataProvider();
355 if ( !provider )
356 return;
358 {
359 QMessageBox askToUser;
360 askToUser.setText( tr( "Save default style to: " ) );
361 askToUser.setIcon( QMessageBox::Question );
362 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
363 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
364 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
365
366 switch ( askToUser.exec() )
367 {
368 case 0:
369 return;
370 case 2:
371 {
372 apply();
373 QString errorMessage;
374 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), QString(), errorMessage ) )
375 {
376 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ), QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
377 {
378 return;
379 }
380 }
381 else if ( !errorMessage.isEmpty() )
382 {
383 QMessageBox::warning( nullptr, QObject::tr( "Save style in database" ), errorMessage );
384 return;
385 }
386
387 mLayer->saveStyleToDatabaseV2( QString(), QString(), true, QString(), errorMsg );
388 if ( errorMsg.isNull() )
389 {
390 return;
391 }
392 break;
393 }
394 default:
395 break;
396 }
397 }
398
400}
401
403{
404 if ( !mLayer->dataProvider() )
405 return;
406 QgsMapLayerSaveStyleDialog dlg( mLayer );
407
408 if ( dlg.exec() )
409 {
410 apply();
411
412 bool defaultLoadedFlag = false;
413 QString errorMessage;
414
415 StyleType type = dlg.currentStyleType();
416 switch ( type )
417 {
418 case QML:
419 case SLD:
420 {
421 QString filePath = dlg.outputFilePath();
422 if ( type == QML )
423 errorMessage = mLayer->saveNamedStyle( filePath, defaultLoadedFlag, dlg.styleCategories() );
424 else
425 {
427 errorMessage = mLayer->saveSldStyleV2( defaultLoadedFlag, sldContext );
428 }
429
430 //reset if the default style was loaded OK only
431 if ( defaultLoadedFlag )
432 {
433 syncToLayer();
434 }
435 else
436 {
437 //let the user know what went wrong
438 QMessageBox::information( this, tr( "Save Style" ), errorMessage );
439 }
440
441 break;
442 }
444 {
445 QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
446
448
449 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), dbSettings.name, errorMessage ) )
450 {
451 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ), QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
452 {
453 return;
454 }
455 }
456 else if ( !errorMessage.isEmpty() )
457 {
458 QMessageBox::warning( this, infoWindowTitle, errorMessage );
459 return;
460 }
461
462 mLayer->saveStyleToDatabaseV2( dbSettings.name, dbSettings.description, dbSettings.isDefault, dbSettings.uiFileContent, errorMessage, dlg.styleCategories() );
463
464 if ( !errorMessage.isNull() )
465 {
466 QMessageBox::warning( this, infoWindowTitle, errorMessage );
467 }
468 else
469 {
470 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
471 }
472 break;
473 }
474 case UserDatabase:
475 {
476 QString infoWindowTitle = tr( "Save default style to local database" );
477 errorMessage = mLayer->saveDefaultStyle( defaultLoadedFlag, dlg.styleCategories() );
478 if ( !defaultLoadedFlag )
479 {
480 QMessageBox::warning( this, infoWindowTitle, errorMessage );
481 }
482 else
483 {
484 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
485 }
486 break;
487 }
488 }
489 }
490}
491
493{
494 QString errorMsg;
495 QStringList ids, names, descriptions;
496
497 //get the list of styles in the db
498 int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg );
499 QgsMapLayerLoadStyleDialog dlg( mLayer, this );
500 dlg.initializeLists( ids, names, descriptions, sectionLimit );
501
502 if ( dlg.exec() )
503 {
504 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
506 StyleType type = dlg.currentStyleType();
507 bool defaultLoadedFlag = false;
508 switch ( type )
509 {
510 case QML:
511 case SLD:
512 {
513 QString filePath = dlg.filePath();
514 if ( type == SLD )
515 {
516 errorMsg = mLayer->loadSldStyle( filePath, defaultLoadedFlag );
517 }
518 else
519 {
520 errorMsg = mLayer->loadNamedStyle( filePath, defaultLoadedFlag, true, categories );
521 }
522 //reset if the default style was loaded OK only
523 if ( defaultLoadedFlag )
524 {
525 syncToLayer();
526 apply();
527 }
528 else
529 {
530 //let the user know what went wrong
531 QMessageBox::warning( this, tr( "Load Style" ), errorMsg );
532 }
533 break;
534 }
536 {
537 QString selectedStyleId = dlg.selectedStyleId();
538
539 QString qmlStyle = mLayer->getStyleFromDatabase( selectedStyleId, errorMsg );
540 if ( !errorMsg.isNull() )
541 {
542 QMessageBox::warning( this, tr( "Load Styles from Database" ), errorMsg );
543 return;
544 }
545
546 QDomDocument myDocument( QStringLiteral( "qgis" ) );
547 myDocument.setContent( qmlStyle );
548
549 if ( mLayer->importNamedStyle( myDocument, errorMsg, categories ) )
550 {
551 syncToLayer();
552 apply();
553 }
554 else
555 {
556 QMessageBox::warning( this, tr( "Load Styles from Database" ), tr( "The retrieved style is not a valid named style. Error message: %1" ).arg( errorMsg ) );
557 }
558 break;
559 }
560 case UserDatabase:
561 {
562 errorMsg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true, categories );
563 //reset if the default style was loaded OK only
564 if ( defaultLoadedFlag )
565 {
566 syncToLayer();
567 apply();
568 }
569 else
570 {
571 QMessageBox::warning( this, tr( "Load Default Style" ), errorMsg );
572 }
573 break;
574 }
575 }
576 activateWindow(); // set focus back to properties dialog
577 }
578}
579
581{
582 if ( !mLayer )
583 return;
584
585 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
586}
587
588QString QgsLayerPropertiesDialog::generateDialogTitle() const
589{
590 QString title = tr( "Layer Properties - %1" ).arg( mLayer->name() );
591
592 if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
593 title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
594
595 return title;
596}
597
599{
600 if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
601 {
602 // need to reset style to previous - style applied directly to the layer (not in apply())
603 QString message;
604 QDomDocument doc( QStringLiteral( "qgis" ) );
605 int errorLine, errorColumn;
606 doc.setContent( mOldStyle.xmlData(), false, &message, &errorLine, &errorColumn );
607 mLayer->importNamedStyle( doc, message );
608 syncToLayer();
609 }
610}
611
613{
615
616 if ( mMetadataPage && mBtnStyle && mBtnMetadata )
617 {
618 const bool isMetadataPanel = ( index == mOptStackedWidget->indexOf( mMetadataPage ) );
619 mBtnStyle->setVisible( !isMetadataPanel );
620 mBtnMetadata->setVisible( isMetadataPanel );
621 }
622}
623
625{
626 QFileInfo file( url.toLocalFile() );
627 if ( file.exists() && !file.isDir() )
628 QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( url.toLocalFile() );
629 else
630 QDesktopServices::openUrl( url );
631}
@ NoVendorExtension
No vendor extensions.
Definition qgis.h:712
Abstract base class for spatial data provider implementations.
virtual Qgis::ProviderStyleStorageCapabilities styleStorageCapabilities() const
Returns the style storage capabilities.
static QString ensureFileNameHasExtension(const QString &fileName, const QStringList &extensions)
Ensures that a fileName ends with an extension from the provided list of extensions.
static QgsNative * nativePlatformInterface()
Returns the global native interface, which offers abstraction to the host OS's underlying public inte...
Definition qgsgui.cpp:96
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
void saveStyleAsDefault()
Saves the current layer style as the default for the layer.
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.
virtual void apply()=0
Applies the dialog settings to the layer.
virtual void syncToLayer()=0
Resets the dialog to the current layer state.
void loadStyle()
Triggers a dialog to load a saved style.
void saveStyleToFile()
Allows the user to save the layer's style to a file.
QgsMapCanvas * mCanvas
Associated map canvas.
void loadDefaultMetadata()
Reloads the default layer metadata for the layer.
void refocusDialog()
Ensures the dialog is focused and activated.
QgsLayerPropertiesDialog(QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor for QgsLayerPropertiesDialog.
void storeCurrentStyleForUndo()
Stores the current layer style so that undo operations can be performed.
QgsMapLayerStyle mOldStyle
Previous layer style.
void loadMetadataFromFile()
Allows the user to load layer metadata from a file.
void saveDefaultStyle()
Saves the default style when appropriate button is pressed.
virtual void addPropertiesPageFactory(const QgsMapLayerConfigWidgetFactory *factory)
Adds properties page from a factory.
void loadStyleFromFile()
Allows the user to load layer style from a file.
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.
Map canvas is a class for displaying all GIS data types on a canvas.
Factory class for creating custom map layer property pages.
virtual bool supportsLayer(QgsMapLayer *layer) const
Check if the layer is supported for this widget.
virtual QIcon icon() const
The icon that will be shown in the UI for the panel.
virtual QgsMapLayerConfigWidget * createWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockWidget=true, QWidget *parent=nullptr) const =0
Factory function to create the widget on demand as needed by the dock.
virtual QString title() const
The title of the panel.
virtual bool supportLayerPropertiesDialog() const
Flag if widget is supported for use in layer properties dialog.
virtual QString layerPropertiesPagePositionHint() const
Returns a tab name hinting at where this page should be inserted into the layer properties tab list.
A panel widget that can be shown in the map style dock.
virtual void syncToLayer(QgsMapLayer *layer)
Reset to original (vector layer) values.
A reusable dialog which allows users to select stored layer styles and categories to load for a map l...
QgsMapLayer::StyleCategories styleCategories() const
Returns the list of selected style categories the user has opted to load.
void initializeLists(const QStringList &ids, const QStringList &names, const QStringList &descriptions, int sectionLimit)
Initialize list of database stored styles.
QString selectedStyleId()
Returns the ID of the selected database stored style.
QString filePath() const
Returns the full path to the selected layer style source file.
QgsLayerPropertiesDialog::StyleType currentStyleType() const
Returns the selected style type.
A dialog which allows saving map layer styles.
QString outputFilePath() const
Returns the selected file output path.
Qgis::SldExportOptions sldExportOptions() const
Returns the SLD export options.
SaveToDbSettings saveToDbSettings() const
Returns the database settings for saving the style in the DB.
QgsMapLayer::StyleCategories styleCategories() const
Returns the available style categories.
QgsLayerPropertiesDialog::StyleType currentStyleType() const
Returns the selected style storage type.
Base class for all map layer types.
Definition qgsmaplayer.h:80
QFlags< StyleCategory > StyleCategories
static QString extensionPropertyType(PropertyType type)
Returns the extension of a Property.
A wizard to edit metadata on a map layer.
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
QgsOptionsDialogBase(const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor.
void addPage(const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QStringList &path=QStringList(), const QString &key=QString())
Adds a new page to the dialog pages.
void restoreOptionsBaseUi(const QString &title=QString())
Restore the base ui.
QStackedWidget * mOptStackedWidget
void insertPage(const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QString &before, const QStringList &path=QStringList(), const QString &key=QString())
Inserts a new page into the dialog pages.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
Stores settings for use within QGIS.
Definition qgssettings.h:65
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
Holds SLD export options and other information related to SLD export of a QGIS layer style.
#define Q_NOWARN_DEPRECATED_POP
Definition qgis.h:7170
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:7169