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