QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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
22#include "qgsnative.h"
23#include "qgssettings.h"
24#include "qgsmaplayer.h"
25#include "qgsmetadatawidget.h"
26#include "qgsproviderregistry.h"
27#include "qgsfileutils.h"
28#include "qgssldexportcontext.h"
29#include "qstackedwidget.h"
30#include "qgsmapcanvas.h"
31
32#include <QDir>
33#include <QFileDialog>
34#include <QMessageBox>
35#include <QDesktopServices>
36
37QgsLayerPropertiesDialog::QgsLayerPropertiesDialog( QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent, Qt::WindowFlags fl, QgsSettings *settings )
38 : QgsOptionsDialogBase( settingsKey, parent, fl, settings )
39 , mCanvas( canvas )
40 , mLayer( layer )
41{
42}
43
45{
46 mMetadataWidget = widget;
47 mMetadataPage = page;
48}
49
51{
52 if ( !mLayer || !mMetadataWidget )
53 return;
54
55 QgsSettings settings; // where we keep last used filter in persistent state
56 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
57
58 const QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Layer Metadata" ), lastUsedDir,
59 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" ),
93 lastUsedDir, tr( "QMD File" ) + " (*.qmd)" );
94 // return dialog focus on Mac
95 activateWindow();
96 raise();
97 if ( outputFileName.isEmpty() )
98 {
99 return;
100 }
101
102 mMetadataWidget->acceptMetadata();
103
104 //ensure the user never omitted the extension from the file name
105 if ( !outputFileName.endsWith( QgsMapLayer::extensionPropertyType( QgsMapLayer::Metadata ), Qt::CaseInsensitive ) )
106 {
108 }
109
110 bool defaultLoadedFlag = false;
111 const QString message = mLayer->saveNamedMetadata( outputFileName, defaultLoadedFlag );
112 if ( defaultLoadedFlag )
113 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
114 else
115 QMessageBox::information( this, tr( "Save Metadata" ), message );
116
118}
119
121{
122 if ( !mLayer || !mMetadataWidget )
123 return;
124
125 mMetadataWidget->acceptMetadata();
126
127 bool defaultSavedFlag = false;
128 const QString errorMsg = mLayer->saveDefaultMetadata( defaultSavedFlag );
129 if ( !defaultSavedFlag )
130 {
131 QMessageBox::warning( this, tr( "Default Metadata" ), errorMsg );
133 }
134}
135
137{
138 if ( !mLayer || !mMetadataWidget )
139 return;
140
141 bool defaultLoadedFlag = false;
142 const QString message = mLayer->loadNamedMetadata( mLayer->metadataUri(), defaultLoadedFlag );
143 //reset if the default metadata was loaded OK only
144 if ( defaultLoadedFlag )
145 {
146 mMetadataWidget->setMetadata( &mLayer->metadata() );
147 }
148 else
149 {
150 QMessageBox::information( this, tr( "Default Metadata" ), message );
152 }
153}
154
156{
157 if ( !mLayer )
158 return;
159
160 QgsSettings settings;
161 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
162
163 QString fileName = QFileDialog::getOpenFileName(
164 this,
165 tr( "Load layer properties from style file" ),
166 lastUsedDir,
167 tr( "QGIS Layer Style File" ) + " (*.qml)" );
168 if ( fileName.isEmpty() )
169 return;
170
171 // ensure the user never omits the extension from the file name
172 if ( !fileName.endsWith( QLatin1String( ".qml" ), Qt::CaseInsensitive ) )
173 fileName += QLatin1String( ".qml" );
174
176
177 bool defaultLoadedFlag = false;
178 const QString message = mLayer->loadNamedStyle( fileName, defaultLoadedFlag );
179 if ( defaultLoadedFlag )
180 {
181 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( fileName ).absolutePath() );
182 syncToLayer();
183 }
184 else
185 {
186 QMessageBox::information( this, tr( "Load Style" ), message );
188 }
189}
190
192{
193 if ( !mLayer )
194 return;
195
196 QgsSettings settings;
197 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
198
199 QString outputFileName = QFileDialog::getSaveFileName(
200 this,
201 tr( "Save layer properties as style file" ),
202 lastUsedDir,
203 tr( "QGIS Layer Style File" ) + " (*.qml)" );
204 // return dialog focus on Mac
205 activateWindow();
206 raise();
207 if ( outputFileName.isEmpty() )
208 return;
209
210 // ensure the user never omits the extension from the file name
211 outputFileName = QgsFileUtils::ensureFileNameHasExtension( outputFileName, QStringList() << QStringLiteral( "qml" ) );
212
213 apply(); // make sure the style to save is up-to-date
214
215 // then export style
216 bool defaultLoadedFlag = false;
217 const QString message = mLayer->saveNamedStyle( outputFileName, defaultLoadedFlag );
218
219 if ( defaultLoadedFlag )
220 {
221 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
222 }
223 else
224 {
225 QMessageBox::information( this, tr( "Save Style" ), message );
227 }
228}
229
231{
232 if ( !mLayer )
233 return;
234
235 apply(); // make sure the style to save is up-to-date
236
237 // a flag passed by reference
238 bool defaultSavedFlag = false;
239 // TODO Once the deprecated `saveDefaultStyle()` method is gone, just
240 // remove the NOWARN_DEPRECATED tags
242 // after calling this the above flag will be set true for success
243 // or false if the save operation failed
244 const QString message = mLayer->saveDefaultStyle( defaultSavedFlag );
246 if ( !defaultSavedFlag )
247 {
248 // let the user know what went wrong
249 QMessageBox::information( this,
250 tr( "Default Style" ),
251 message
252 );
254 }
255}
256
258{
259 restoreOptionsBaseUi( generateDialogTitle() );
260}
261
263{
264 activateWindow(); // set focus back to properties dialog
265}
266
268{
269 if ( !factory->supportsLayer( mLayer ) || !factory->supportLayerPropertiesDialog() )
270 {
271 return;
272 }
273
274 QgsMapLayerConfigWidget *page = factory->createWidget( mLayer, mCanvas, false, this );
275 mConfigWidgets << page;
276
277 const QString beforePage = factory->layerPropertiesPagePositionHint();
278 if ( beforePage.isEmpty() )
279 addPage( factory->title(), factory->title(), factory->icon(), page );
280 else
281 insertPage( factory->title(), factory->title(), factory->icon(), page, beforePage );
282
283 page->syncToLayer( mLayer );
284}
285
287{
288 QString msg;
289 bool defaultLoadedFlag = false;
290
291 const QgsDataProvider *provider = mLayer->dataProvider();
292 if ( !provider )
293 return;
295 {
296 QMessageBox askToUser;
297 askToUser.setText( tr( "Load default style from: " ) );
298 askToUser.setIcon( QMessageBox::Question );
299 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
300 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
301 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
302
303 switch ( askToUser.exec() )
304 {
305 case 0:
306 return;
307 case 2:
308 msg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, false );
309 if ( !defaultLoadedFlag )
310 {
311 //something went wrong - let them know why
312 QMessageBox::information( this, tr( "Default Style" ), msg );
313 }
314 if ( msg.compare( tr( "Loaded from Provider" ) ) )
315 {
316 QMessageBox::information( this, tr( "Default Style" ),
317 tr( "No default style was found for this layer." ) );
318 }
319 else
320 {
321 syncToLayer();
322 apply();
323 }
324
325 return;
326 default:
327 break;
328 }
329 }
330
331 QString myMessage = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true );
332 // QString myMessage = layer->loadDefaultStyle( defaultLoadedFlag );
333 //reset if the default style was loaded OK only
334 if ( defaultLoadedFlag )
335 {
336 // all worked OK so no need to inform user
337 syncToLayer();
338 apply();
339 }
340 else
341 {
342 //something went wrong - let them know why
343 QMessageBox::information( this, tr( "Default Style" ), myMessage );
344 }
345}
346
348{
349 QString errorMsg;
350 const QgsDataProvider *provider = mLayer->dataProvider();
351 if ( !provider )
352 return;
354 {
355 QMessageBox askToUser;
356 askToUser.setText( tr( "Save default style to: " ) );
357 askToUser.setIcon( QMessageBox::Question );
358 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
359 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
360 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
361
362 switch ( askToUser.exec() )
363 {
364 case 0:
365 return;
366 case 2:
367 {
368 apply();
369 QString errorMessage;
370 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), QString(), errorMessage ) )
371 {
372 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
373 QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
374 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" ),
382 errorMessage );
383 return;
384 }
385
386 mLayer->saveStyleToDatabase( QString(), QString(), true, QString(), errorMsg );
387 if ( errorMsg.isNull() )
388 {
389 return;
390 }
391 break;
392 }
393 default:
394 break;
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::question( nullptr, QObject::tr( "Save style in database" ),
451 QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
452 QMessageBox::Yes | QMessageBox::No ) == 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->saveStyleToDatabase( 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() );
506 QgsMapLayer::StyleCategories categories = dlg.styleCategories();
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( QStringLiteral( "qgis" ) );
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" ),
558 tr( "The retrieved style is not a valid named style. Error message: %1" )
559 .arg( errorMsg ) );
560 }
561 break;
562 }
563 case UserDatabase:
564 {
565 errorMsg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true, categories );
566 //reset if the default style was loaded OK only
567 if ( defaultLoadedFlag )
568 {
569 syncToLayer();
570 apply();
571 }
572 else
573 {
574 QMessageBox::warning( this, tr( "Load Default Style" ), errorMsg );
575 }
576 break;
577 }
578 }
579 activateWindow(); // set focus back to properties dialog
580 }
581}
582
584{
585 if ( !mLayer )
586 return;
587
588 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
589}
590
591QString QgsLayerPropertiesDialog::generateDialogTitle() const
592{
593 QString title = tr( "Layer Properties - %1" ).arg( mLayer->name() );
594
595 if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
596 title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
597
598 return title;
599}
600
602{
603 if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
604 {
605 // need to reset style to previous - style applied directly to the layer (not in apply())
606 QString message;
607 QDomDocument doc( QStringLiteral( "qgis" ) );
608 int errorLine, errorColumn;
609 doc.setContent( mOldStyle.xmlData(), false, &message, &errorLine, &errorColumn );
610 mLayer->importNamedStyle( doc, message );
611 syncToLayer();
612 }
613}
614
616{
618
619 if ( mMetadataPage && mBtnStyle && mBtnMetadata )
620 {
621 const bool isMetadataPanel = ( index == mOptStackedWidget->indexOf( mMetadataPage ) );
622 mBtnStyle->setVisible( ! isMetadataPanel );
623 mBtnMetadata->setVisible( isMetadataPanel );
624 }
625}
626
628{
629 QFileInfo file( url.toLocalFile() );
630 if ( file.exists() && !file.isDir() )
631 QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( url.toLocalFile() );
632 else
633 QDesktopServices::openUrl( url );
634}
@ 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:79
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:74
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:63
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:4916
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:4915