QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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 infoWindowTitle = QObject::tr( "Save Default Metadata" );
129 const QString errorMsg = mLayer->saveDefaultMetadata( defaultSavedFlag );
130 if ( !defaultSavedFlag )
131 {
132 QMessageBox::warning( this, infoWindowTitle, errorMsg );
134 }
135 else
136 {
137 QMessageBox::information( this, infoWindowTitle, tr( "Metadata saved." ) );
138 }
139}
140
142{
143 if ( !mLayer || !mMetadataWidget )
144 return;
145
146 bool defaultLoadedFlag = false;
147 const QString message = mLayer->loadNamedMetadata( mLayer->metadataUri(), defaultLoadedFlag );
148 //reset if the default metadata was loaded OK only
149 if ( defaultLoadedFlag )
150 {
151 mMetadataWidget->setMetadata( &mLayer->metadata() );
152 }
153 else
154 {
155 QMessageBox::information( this, tr( "Default Metadata" ), message );
157 }
158}
159
161{
162 if ( !mLayer )
163 return;
164
165 QgsSettings settings;
166 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
167
168 QString fileName = QFileDialog::getOpenFileName(
169 this,
170 tr( "Load layer properties from style file" ),
171 lastUsedDir,
172 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( 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 // return dialog focus on Mac
210 activateWindow();
211 raise();
212 if ( outputFileName.isEmpty() )
213 return;
214
215 // ensure the user never omits the extension from the file name
216 outputFileName = QgsFileUtils::ensureFileNameHasExtension( outputFileName, QStringList() << QStringLiteral( "qml" ) );
217
218 apply(); // make sure the style to save is up-to-date
219
220 // then export style
221 bool defaultLoadedFlag = false;
222 const QString message = mLayer->saveNamedStyle( outputFileName, defaultLoadedFlag );
223
224 if ( defaultLoadedFlag )
225 {
226 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
227 }
228 else
229 {
230 QMessageBox::information( this, tr( "Save Style" ), message );
232 }
233}
234
236{
237 if ( !mLayer )
238 return;
239
240 apply(); // make sure the style to save is up-to-date
241
242 // a flag passed by reference
243 bool defaultSavedFlag = false;
244 // TODO Once the deprecated `saveDefaultStyle()` method is gone, just
245 // remove the NOWARN_DEPRECATED tags
247 // after calling this the above flag will be set true for success
248 // or false if the save operation failed
249 const QString message = mLayer->saveDefaultStyle( defaultSavedFlag );
251 if ( !defaultSavedFlag )
252 {
253 // let the user know what went wrong
254 QMessageBox::information( this,
255 tr( "Default Style" ),
256 message
257 );
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" ),
322 tr( "No default style was found for this layer." ) );
323 }
324 else
325 {
326 syncToLayer();
327 apply();
328 }
329
330 return;
331 default:
332 break;
333 }
334 }
335
336 QString myMessage = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true );
337 // QString myMessage = layer->loadDefaultStyle( defaultLoadedFlag );
338 //reset if the default style was loaded OK only
339 if ( defaultLoadedFlag )
340 {
341 // all worked OK so no need to inform user
342 syncToLayer();
343 apply();
344 }
345 else
346 {
347 //something went wrong - let them know why
348 QMessageBox::information( this, tr( "Default Style" ), myMessage );
349 }
350}
351
353{
354 QString errorMsg;
355 const QgsDataProvider *provider = mLayer->dataProvider();
356 if ( !provider )
357 return;
359 {
360 QMessageBox askToUser;
361 askToUser.setText( tr( "Save default style to: " ) );
362 askToUser.setIcon( QMessageBox::Question );
363 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
364 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
365 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
366
367 switch ( askToUser.exec() )
368 {
369 case 0:
370 return;
371 case 2:
372 {
373 apply();
374 QString errorMessage;
375 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), QString(), errorMessage ) )
376 {
377 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
378 QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
379 QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
380 {
381 return;
382 }
383 }
384 else if ( !errorMessage.isEmpty() )
385 {
386 QMessageBox::warning( nullptr, QObject::tr( "Save style in database" ),
387 errorMessage );
388 return;
389 }
390
391 mLayer->saveStyleToDatabase( QString(), QString(), true, QString(), errorMsg );
392 if ( errorMsg.isNull() )
393 {
394 return;
395 }
396 break;
397 }
398 default:
399 break;
400 }
401 }
402
404}
405
407{
408 if ( !mLayer->dataProvider() )
409 return;
410 QgsMapLayerSaveStyleDialog dlg( mLayer );
411
412 if ( dlg.exec() )
413 {
414 apply();
415
416 bool defaultLoadedFlag = false;
417 QString errorMessage;
418
419 StyleType type = dlg.currentStyleType();
420 switch ( type )
421 {
422 case QML:
423 case SLD:
424 {
425 QString filePath = dlg.outputFilePath();
426 if ( type == QML )
427 errorMessage = mLayer->saveNamedStyle( filePath, defaultLoadedFlag, dlg.styleCategories() );
428 else
429 {
431 errorMessage = mLayer->saveSldStyleV2( defaultLoadedFlag, sldContext );
432 }
433
434 //reset if the default style was loaded OK only
435 if ( defaultLoadedFlag )
436 {
437 syncToLayer();
438 }
439 else
440 {
441 //let the user know what went wrong
442 QMessageBox::information( this, tr( "Save Style" ), errorMessage );
443 }
444
445 break;
446 }
448 {
449 QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
450
452
453 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), dbSettings.name, errorMessage ) )
454 {
455 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
456 QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
457 QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
458 {
459 return;
460 }
461 }
462 else if ( !errorMessage.isEmpty() )
463 {
464 QMessageBox::warning( this, infoWindowTitle, errorMessage );
465 return;
466 }
467
468 mLayer->saveStyleToDatabase( dbSettings.name, dbSettings.description, dbSettings.isDefault, dbSettings.uiFileContent, errorMessage, dlg.styleCategories() );
469
470 if ( !errorMessage.isNull() )
471 {
472 QMessageBox::warning( this, infoWindowTitle, errorMessage );
473 }
474 else
475 {
476 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
477 }
478 break;
479 }
480 case UserDatabase:
481 {
482 QString infoWindowTitle = tr( "Save default style to local database" );
483 errorMessage = mLayer->saveDefaultStyle( defaultLoadedFlag, dlg.styleCategories() );
484 if ( !defaultLoadedFlag )
485 {
486 QMessageBox::warning( this, infoWindowTitle, errorMessage );
487 }
488 else
489 {
490 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
491 }
492 break;
493 }
494 }
495 }
496}
497
499{
500 QString errorMsg;
501 QStringList ids, names, descriptions;
502
503 //get the list of styles in the db
504 int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg );
505 QgsMapLayerLoadStyleDialog dlg( mLayer, this );
506 dlg.initializeLists( ids, names, descriptions, sectionLimit );
507
508 if ( dlg.exec() )
509 {
510 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
512 StyleType type = dlg.currentStyleType();
513 bool defaultLoadedFlag = false;
514 switch ( type )
515 {
516 case QML:
517 case SLD:
518 {
519 QString filePath = dlg.filePath();
520 if ( type == SLD )
521 {
522 errorMsg = mLayer->loadSldStyle( filePath, defaultLoadedFlag );
523 }
524 else
525 {
526 errorMsg = mLayer->loadNamedStyle( filePath, defaultLoadedFlag, true, categories );
527 }
528 //reset if the default style was loaded OK only
529 if ( defaultLoadedFlag )
530 {
531 syncToLayer();
532 apply();
533 }
534 else
535 {
536 //let the user know what went wrong
537 QMessageBox::warning( this, tr( "Load Style" ), errorMsg );
538 }
539 break;
540 }
542 {
543 QString selectedStyleId = dlg.selectedStyleId();
544
545 QString qmlStyle = mLayer->getStyleFromDatabase( selectedStyleId, errorMsg );
546 if ( !errorMsg.isNull() )
547 {
548 QMessageBox::warning( this, tr( "Load Styles from Database" ), errorMsg );
549 return;
550 }
551
552 QDomDocument myDocument( QStringLiteral( "qgis" ) );
553 myDocument.setContent( qmlStyle );
554
555 if ( mLayer->importNamedStyle( myDocument, errorMsg, categories ) )
556 {
557 syncToLayer();
558 apply();
559 }
560 else
561 {
562 QMessageBox::warning( this, tr( "Load Styles from Database" ),
563 tr( "The retrieved style is not a valid named style. Error message: %1" )
564 .arg( errorMsg ) );
565 }
566 break;
567 }
568 case UserDatabase:
569 {
570 errorMsg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true, categories );
571 //reset if the default style was loaded OK only
572 if ( defaultLoadedFlag )
573 {
574 syncToLayer();
575 apply();
576 }
577 else
578 {
579 QMessageBox::warning( this, tr( "Load Default Style" ), errorMsg );
580 }
581 break;
582 }
583 }
584 activateWindow(); // set focus back to properties dialog
585 }
586}
587
589{
590 if ( !mLayer )
591 return;
592
593 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
594}
595
596QString QgsLayerPropertiesDialog::generateDialogTitle() const
597{
598 QString title = tr( "Layer Properties - %1" ).arg( mLayer->name() );
599
600 if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
601 title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
602
603 return title;
604}
605
607{
608 if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
609 {
610 // need to reset style to previous - style applied directly to the layer (not in apply())
611 QString message;
612 QDomDocument doc( QStringLiteral( "qgis" ) );
613 int errorLine, errorColumn;
614 doc.setContent( mOldStyle.xmlData(), false, &message, &errorLine, &errorColumn );
615 mLayer->importNamedStyle( doc, message );
616 syncToLayer();
617 }
618}
619
621{
623
624 if ( mMetadataPage && mBtnStyle && mBtnMetadata )
625 {
626 const bool isMetadataPanel = ( index == mOptStackedWidget->indexOf( mMetadataPage ) );
627 mBtnStyle->setVisible( ! isMetadataPanel );
628 mBtnMetadata->setVisible( isMetadataPanel );
629 }
630}
631
633{
634 QFileInfo file( url.toLocalFile() );
635 if ( file.exists() && !file.isDir() )
636 QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( url.toLocalFile() );
637 else
638 QDesktopServices::openUrl( url );
639}
@ 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:83
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:6494
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:6493