QGIS API Documentation 4.3.0-Master (91d4a333d5d)
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 <QPushButton>
37#include <QString>
38#include <qstackedwidget.h>
39
40#include "moc_qgslayerpropertiesdialog.cpp"
41
42using namespace Qt::StringLiterals;
43
44QgsLayerPropertiesDialog::QgsLayerPropertiesDialog( QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent, Qt::WindowFlags fl, QgsSettings *settings )
45 : QgsOptionsDialogBase( settingsKey, parent, fl, settings )
46 , mCanvas( canvas )
47 , mLayer( layer )
48{}
49
51{
52 mMetadataWidget = widget;
53 mMetadataPage = page;
54}
55
57{
58 if ( !mLayer || !mMetadataWidget )
59 return;
60
61 QgsSettings settings; // where we keep last used filter in persistent state
62 const QString lastUsedDir = settings.value( u"style/lastStyleDir"_s, QDir::homePath() ).toString();
63
64 const QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Layer Metadata" ), lastUsedDir, tr( "QGIS Layer Metadata File" ) + " (*.qmd)" );
65 if ( fileName.isNull() )
66 {
67 return;
68 }
69
70 bool defaultLoadedFlag = false;
71 const QString message = mLayer->loadNamedMetadata( fileName, defaultLoadedFlag );
72
73 //reset if the default style was loaded OK only
74 if ( defaultLoadedFlag )
75 {
76 mMetadataWidget->setMetadata( &mLayer->metadata() );
77 }
78 else
79 {
80 //let the user know what went wrong
81 QMessageBox::warning( this, tr( "Load Metadata" ), message );
82 }
83
84 settings.setValue( u"style/lastStyleDir"_s, QFileInfo( fileName ).path() );
85
87}
88
90{
91 if ( !mLayer || !mMetadataWidget )
92 return;
93
94 QgsSettings settings; // where we keep last used filter in persistent state
95 const QString lastUsedDir = settings.value( u"style/lastStyleDir"_s, QDir::homePath() ).toString();
96
97 QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save Layer Metadata as QMD" ), lastUsedDir, tr( "QMD File" ) + " (*.qmd)" );
98 // return dialog focus on Mac
99 activateWindow();
100 raise();
101 if ( outputFileName.isEmpty() )
102 {
103 return;
104 }
105
106 mMetadataWidget->acceptMetadata();
107
108 //ensure the user never omitted the extension from the file name
109 if ( !outputFileName.endsWith( QgsMapLayer::extensionPropertyType( QgsMapLayer::Metadata ), Qt::CaseInsensitive ) )
110 {
112 }
113
114 bool defaultLoadedFlag = false;
115 const QString message = mLayer->saveNamedMetadata( outputFileName, defaultLoadedFlag );
116 if ( defaultLoadedFlag )
117 settings.setValue( u"style/lastStyleDir"_s, QFileInfo( outputFileName ).absolutePath() );
118 else
119 QMessageBox::information( this, tr( "Save Metadata" ), message );
120
122}
123
125{
126 if ( !mLayer || !mMetadataWidget )
127 return;
128
129 mMetadataWidget->acceptMetadata();
130
131 bool defaultSavedFlag = false;
132 const QString infoWindowTitle = QObject::tr( "Save Default Metadata" );
133 const QString errorMsg = mLayer->saveDefaultMetadata( defaultSavedFlag );
134 if ( !defaultSavedFlag )
135 {
136 QMessageBox::warning( this, infoWindowTitle, errorMsg );
138 }
139 else
140 {
141 QMessageBox::information( this, infoWindowTitle, tr( "Metadata saved." ) );
142 }
143}
144
146{
147 if ( !mLayer || !mMetadataWidget )
148 return;
149
150 bool defaultLoadedFlag = false;
151 const QString message = mLayer->loadNamedMetadata( mLayer->metadataUri(), defaultLoadedFlag );
152 //reset if the default metadata was loaded OK only
153 if ( defaultLoadedFlag )
154 {
155 mMetadataWidget->setMetadata( &mLayer->metadata() );
156 }
157 else
158 {
159 QMessageBox::information( this, tr( "Default Metadata" ), message );
161 }
162}
163
165{
166 if ( !mLayer )
167 return;
168
169 QgsSettings settings;
170 const QString lastUsedDir = settings.value( u"style/lastStyleDir"_s, QDir::homePath() ).toString();
171
172 QString fileName = QFileDialog::getOpenFileName( this, tr( "Load layer properties from style file" ), lastUsedDir, tr( "QGIS Layer Style File" ) + " (*.qml)" );
173 if ( fileName.isEmpty() )
174 return;
175
176 // ensure the user never omits the extension from the file name
177 if ( !fileName.endsWith( ".qml"_L1, Qt::CaseInsensitive ) )
178 fileName += ".qml"_L1;
179
181
182 bool defaultLoadedFlag = false;
183 const QString message = mLayer->loadNamedStyle( fileName, defaultLoadedFlag );
184 if ( defaultLoadedFlag )
185 {
186 settings.setValue( u"style/lastStyleDir"_s, QFileInfo( fileName ).absolutePath() );
187 syncToLayer();
188 }
189 else
190 {
191 QMessageBox::information( this, tr( "Load Style" ), message );
193 }
194}
195
197{
198 if ( !mLayer )
199 return;
200
201 QgsSettings settings;
202 const QString lastUsedDir = settings.value( u"style/lastStyleDir"_s, QDir::homePath() ).toString();
203
204 QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save layer properties as style file" ), lastUsedDir, tr( "QGIS Layer Style File" ) + " (*.qml)" );
205 // return dialog focus on Mac
206 activateWindow();
207 raise();
208 if ( outputFileName.isEmpty() )
209 return;
210
211 // ensure the user never omits the extension from the file name
212 outputFileName = QgsFileUtils::ensureFileNameHasExtension( outputFileName, QStringList() << u"qml"_s );
213
214 apply(); // make sure the style to save is up-to-date
215
216 // then export style
217 bool defaultLoadedFlag = false;
218 const QString message = mLayer->saveNamedStyle( outputFileName, defaultLoadedFlag );
219
220 if ( defaultLoadedFlag )
221 {
222 settings.setValue( u"style/lastStyleDir"_s, QFileInfo( outputFileName ).absolutePath() );
223 }
224 else
225 {
226 QMessageBox::information( this, tr( "Save Style" ), message );
228 }
229}
230
232{
233 if ( !mLayer )
234 return;
235
236 apply(); // make sure the style to save is up-to-date
237
238 // a flag passed by reference
239 bool defaultSavedFlag = false;
240 // TODO Once the deprecated `saveDefaultStyle()` method is gone, just
241 // remove the NOWARN_DEPRECATED tags
243 // after calling this the above flag will be set true for success
244 // or false if the save operation failed
245 const QString message = mLayer->saveDefaultStyle( defaultSavedFlag );
247 if ( !defaultSavedFlag )
248 {
249 // let the user know what went wrong
250 QMessageBox::information( this, tr( "Default Style" ), message );
252 }
253}
254
256{
257 restoreOptionsBaseUi( generateDialogTitle() );
258}
259
261{
262 activateWindow(); // set focus back to properties dialog
263}
264
266{
267 if ( !factory || !factory->supportsLayer( mLayer ) || !factory->supportLayerPropertiesDialog() )
268 {
269 return;
270 }
271
272 QgsMapLayerConfigWidget *page = factory->createWidget( mLayer, mCanvas, false, this );
273 if ( !page )
274 {
275 QgsDebugError( u"Failed to create widget from factory '%1'"_s.arg( factory->title() ) );
276 return;
277 }
278
279 mConfigWidgets << page;
280
281 const QString beforePage = factory->layerPropertiesPagePositionHint();
282 if ( beforePage.isEmpty() )
283 addPage( factory->title(), factory->title(), factory->icon(), page );
284 else
285 insertPage( factory->title(), factory->title(), factory->icon(), page, beforePage );
286
287 page->syncToLayer( mLayer );
288}
289
291{
292 QString msg;
293 bool defaultLoadedFlag = false;
294
295 const QgsDataProvider *provider = mLayer->dataProvider();
296 if ( !provider )
297 return;
299 {
300 QMessageBox askToUser;
301 askToUser.setText( tr( "Load default style from: " ) );
302 askToUser.setIcon( QMessageBox::Question );
303 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
304 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
305 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
306
307 switch ( askToUser.exec() )
308 {
309 case 0:
310 return;
311 case 2:
312 msg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, false );
313 if ( !defaultLoadedFlag )
314 {
315 //something went wrong - let them know why
316 QMessageBox::information( this, tr( "Default Style" ), msg );
317 }
318 if ( msg.compare( tr( "Loaded from Provider" ) ) )
319 {
320 QMessageBox::information( this, tr( "Default Style" ), tr( "No default style was found for this layer." ) );
321 }
322 else
323 {
324 syncToLayer();
325 apply();
326 }
327
328 return;
329 default:
330 break;
331 }
332 }
333
334 QString myMessage = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true );
335 // QString myMessage = layer->loadDefaultStyle( defaultLoadedFlag );
336 //reset if the default style was loaded OK only
337 if ( defaultLoadedFlag )
338 {
339 // all worked OK so no need to inform user
340 syncToLayer();
341 apply();
342 }
343 else
344 {
345 //something went wrong - let them know why
346 QMessageBox::information( this, tr( "Default Style" ), myMessage );
347 }
348}
349
351{
352 QString errorMsg;
353 const QgsDataProvider *provider = mLayer->dataProvider();
354 if ( !provider )
355 return;
357 {
358 QMessageBox askToUser;
359 askToUser.setText( tr( "Save default style to: " ) );
360 askToUser.setIcon( QMessageBox::Question );
361 QPushButton *cancelButton = askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
362 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
363 QPushButton *datasourceButton = askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
364
365 askToUser.exec();
366
367 if ( askToUser.clickedButton() == cancelButton )
368 {
369 return;
370 }
371 else if ( askToUser.clickedButton() == datasourceButton )
372 {
373 apply();
374 QString errorMessage;
375 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), QString(), errorMessage ) )
376 {
377 if ( QMessageBox::
378 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 )
379 == QMessageBox::No )
380 {
381 return;
382 }
383 }
384 else if ( !errorMessage.isEmpty() )
385 {
386 QMessageBox::warning( nullptr, QObject::tr( "Save style in database" ), errorMessage );
387 return;
388 }
389
390 mLayer->saveStyleToDatabaseV2( QString(), QString(), true, QString(), errorMsg );
391 if ( errorMsg.isNull() )
392 {
393 return;
394 }
395 }
396 }
397
399}
400
402{
403 if ( !mLayer->dataProvider() )
404 return;
405 QgsMapLayerSaveStyleDialog dlg( mLayer );
406
407 if ( dlg.exec() )
408 {
409 apply();
410
411 bool defaultLoadedFlag = false;
412 QString errorMessage;
413
414 StyleType type = dlg.currentStyleType();
415 switch ( type )
416 {
417 case QML:
418 case SLD:
419 {
420 QString filePath = dlg.outputFilePath();
421 if ( type == QML )
422 errorMessage = mLayer->saveNamedStyle( filePath, defaultLoadedFlag, dlg.styleCategories() );
423 else
424 {
426 errorMessage = mLayer->saveSldStyleV2( defaultLoadedFlag, sldContext );
427 }
428
429 //reset if the default style was loaded OK only
430 if ( defaultLoadedFlag )
431 {
432 syncToLayer();
433 }
434 else
435 {
436 //let the user know what went wrong
437 QMessageBox::information( this, tr( "Save Style" ), errorMessage );
438 }
439
440 break;
441 }
443 {
444 QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
445
447
448 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), dbSettings.name, errorMessage ) )
449 {
450 if ( QMessageBox::
451 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 )
452 == QMessageBox::No )
453 {
454 return;
455 }
456 }
457 else if ( !errorMessage.isEmpty() )
458 {
459 QMessageBox::warning( this, infoWindowTitle, errorMessage );
460 return;
461 }
462
463 mLayer->saveStyleToDatabaseV2( dbSettings.name, dbSettings.description, dbSettings.isDefault, dbSettings.uiFileContent, errorMessage, dlg.styleCategories() );
464
465 if ( !errorMessage.isNull() )
466 {
467 QMessageBox::warning( this, infoWindowTitle, errorMessage );
468 }
469 else
470 {
471 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
472 }
473 break;
474 }
475 case UserDatabase:
476 {
477 QString infoWindowTitle = tr( "Save default style to local database" );
478 errorMessage = mLayer->saveDefaultStyle( defaultLoadedFlag, dlg.styleCategories() );
479 if ( !defaultLoadedFlag )
480 {
481 QMessageBox::warning( this, infoWindowTitle, errorMessage );
482 }
483 else
484 {
485 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
486 }
487 break;
488 }
489 }
490 }
491}
492
494{
495 QString errorMsg;
496 QStringList ids, names, descriptions;
497
498 //get the list of styles in the db
499 int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg );
500 QgsMapLayerLoadStyleDialog dlg( mLayer, this );
501 dlg.initializeLists( ids, names, descriptions, sectionLimit );
502
503 if ( dlg.exec() )
504 {
505 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
507 StyleType type = dlg.currentStyleType();
508 bool defaultLoadedFlag = false;
509 switch ( type )
510 {
511 case QML:
512 case SLD:
513 {
514 QString filePath = dlg.filePath();
515 if ( type == SLD )
516 {
517 errorMsg = mLayer->loadSldStyle( filePath, defaultLoadedFlag );
518 }
519 else
520 {
521 errorMsg = mLayer->loadNamedStyle( filePath, defaultLoadedFlag, true, categories );
522 }
523 //reset if the default style was loaded OK only
524 if ( defaultLoadedFlag )
525 {
526 syncToLayer();
527 apply();
528 }
529 else
530 {
531 //let the user know what went wrong
532 QMessageBox::warning( this, tr( "Load Style" ), errorMsg );
533 }
534 break;
535 }
537 {
538 QString selectedStyleId = dlg.selectedStyleId();
539
540 QString qmlStyle = mLayer->getStyleFromDatabase( selectedStyleId, errorMsg );
541 if ( !errorMsg.isNull() )
542 {
543 QMessageBox::warning( this, tr( "Load Styles from Database" ), errorMsg );
544 return;
545 }
546
547 QDomDocument myDocument( u"qgis"_s );
548 myDocument.setContent( qmlStyle );
549
550 if ( mLayer->importNamedStyle( myDocument, errorMsg, categories ) )
551 {
552 syncToLayer();
553 apply();
554 }
555 else
556 {
557 QMessageBox::warning( this, tr( "Load Styles from Database" ), tr( "The retrieved style is not a valid named style. Error message: %1" ).arg( errorMsg ) );
558 }
559 break;
560 }
561 case UserDatabase:
562 {
563 errorMsg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true, categories );
564 //reset if the default style was loaded OK only
565 if ( defaultLoadedFlag )
566 {
567 syncToLayer();
568 apply();
569 }
570 else
571 {
572 QMessageBox::warning( this, tr( "Load Default Style" ), errorMsg );
573 }
574 break;
575 }
576 }
577 activateWindow(); // set focus back to properties dialog
578 }
579}
580
582{
583 if ( !mLayer )
584 return;
585
586 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
587}
588
589QString QgsLayerPropertiesDialog::generateDialogTitle() const
590{
591 QString title = tr( "Layer Properties - %1" ).arg( mLayer->name() );
592
593 if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
594 title += u" (%1)"_s.arg( mLayer->styleManager()->currentStyle() );
595
596 return title;
597}
598
600{
601 if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
602 {
603 // need to reset style to previous - style applied directly to the layer (not in apply())
604 QString message;
605 QDomDocument doc( u"qgis"_s );
606 int errorLine, errorColumn;
607 doc.setContent( mOldStyle.xmlData(), false, &message, &errorLine, &errorColumn );
608 mLayer->importNamedStyle( doc, message );
609 syncToLayer();
610 }
611}
612
614{
616
617 if ( mMetadataPage && mBtnStyle && mBtnMetadata )
618 {
619 const bool isMetadataPanel = ( index == mOptStackedWidget->indexOf( mMetadataPage ) );
620 mBtnStyle->setVisible( !isMetadataPanel );
621 mBtnMetadata->setVisible( isMetadataPanel );
622 }
623}
624
626{
627 QFileInfo file( url.toLocalFile() );
628 if ( file.exists() && !file.isDir() )
629 QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( url.toLocalFile() );
630 else
631 QDesktopServices::openUrl( url );
632}
@ NoVendorExtension
No vendor extensions.
Definition qgis.h:773
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:100
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:84
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:68
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:8447
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:8446
#define QgsDebugError(str)
Definition qgslogger.h:71