QGIS API Documentation 3.41.0-Master (3440c17df1d)
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,
60 tr( "QGIS Layer Metadata File" ) + " (*.qmd)" );
61 if ( fileName.isNull() )
62 {
63 return;
64 }
65
66 bool defaultLoadedFlag = false;
67 const QString message = mLayer->loadNamedMetadata( fileName, defaultLoadedFlag );
68
69 //reset if the default style was loaded OK only
70 if ( defaultLoadedFlag )
71 {
72 mMetadataWidget->setMetadata( &mLayer->metadata() );
73 }
74 else
75 {
76 //let the user know what went wrong
77 QMessageBox::warning( this, tr( "Load Metadata" ), message );
78 }
79
80 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( fileName ).path() );
81
83}
84
86{
87 if ( !mLayer || !mMetadataWidget )
88 return;
89
90 QgsSettings settings; // where we keep last used filter in persistent state
91 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
92
93 QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save Layer Metadata as QMD" ),
94 lastUsedDir, tr( "QMD File" ) + " (*.qmd)" );
95 // return dialog focus on Mac
96 activateWindow();
97 raise();
98 if ( outputFileName.isEmpty() )
99 {
100 return;
101 }
102
103 mMetadataWidget->acceptMetadata();
104
105 //ensure the user never omitted the extension from the file name
106 if ( !outputFileName.endsWith( QgsMapLayer::extensionPropertyType( QgsMapLayer::Metadata ), Qt::CaseInsensitive ) )
107 {
109 }
110
111 bool defaultLoadedFlag = false;
112 const QString message = mLayer->saveNamedMetadata( outputFileName, defaultLoadedFlag );
113 if ( defaultLoadedFlag )
114 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
115 else
116 QMessageBox::information( this, tr( "Save Metadata" ), message );
117
119}
120
122{
123 if ( !mLayer || !mMetadataWidget )
124 return;
125
126 mMetadataWidget->acceptMetadata();
127
128 bool defaultSavedFlag = false;
129 const QString infoWindowTitle = QObject::tr( "Save Default Metadata" );
130 const QString errorMsg = mLayer->saveDefaultMetadata( defaultSavedFlag );
131 if ( !defaultSavedFlag )
132 {
133 QMessageBox::warning( this, infoWindowTitle, errorMsg );
135 }
136 else
137 {
138 QMessageBox::information( this, infoWindowTitle, tr( "Metadata saved." ) );
139 }
140}
141
143{
144 if ( !mLayer || !mMetadataWidget )
145 return;
146
147 bool defaultLoadedFlag = false;
148 const QString message = mLayer->loadNamedMetadata( mLayer->metadataUri(), defaultLoadedFlag );
149 //reset if the default metadata was loaded OK only
150 if ( defaultLoadedFlag )
151 {
152 mMetadataWidget->setMetadata( &mLayer->metadata() );
153 }
154 else
155 {
156 QMessageBox::information( this, tr( "Default Metadata" ), message );
158 }
159}
160
162{
163 if ( !mLayer )
164 return;
165
166 QgsSettings settings;
167 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
168
169 QString fileName = QFileDialog::getOpenFileName(
170 this,
171 tr( "Load layer properties from style file" ),
172 lastUsedDir,
173 tr( "QGIS Layer Style File" ) + " (*.qml)" );
174 if ( fileName.isEmpty() )
175 return;
176
177 // ensure the user never omits the extension from the file name
178 if ( !fileName.endsWith( QLatin1String( ".qml" ), Qt::CaseInsensitive ) )
179 fileName += QLatin1String( ".qml" );
180
182
183 bool defaultLoadedFlag = false;
184 const QString message = mLayer->loadNamedStyle( fileName, defaultLoadedFlag );
185 if ( defaultLoadedFlag )
186 {
187 settings.setValue( QStringLiteral( "style/lastStyleDir" ), QFileInfo( fileName ).absolutePath() );
188 syncToLayer();
189 }
190 else
191 {
192 QMessageBox::information( this, tr( "Load Style" ), message );
194 }
195}
196
198{
199 if ( !mLayer )
200 return;
201
202 QgsSettings settings;
203 const QString lastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
204
205 QString outputFileName = QFileDialog::getSaveFileName(
206 this,
207 tr( "Save layer properties as style file" ),
208 lastUsedDir,
209 tr( "QGIS Layer Style File" ) + " (*.qml)" );
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,
256 tr( "Default Style" ),
257 message
258 );
260 }
261}
262
264{
265 restoreOptionsBaseUi( generateDialogTitle() );
266}
267
269{
270 activateWindow(); // set focus back to properties dialog
271}
272
274{
275 if ( !factory->supportsLayer( mLayer ) || !factory->supportLayerPropertiesDialog() )
276 {
277 return;
278 }
279
280 QgsMapLayerConfigWidget *page = factory->createWidget( mLayer, mCanvas, false, this );
281 mConfigWidgets << page;
282
283 const QString beforePage = factory->layerPropertiesPagePositionHint();
284 if ( beforePage.isEmpty() )
285 addPage( factory->title(), factory->title(), factory->icon(), page );
286 else
287 insertPage( factory->title(), factory->title(), factory->icon(), page, beforePage );
288
289 page->syncToLayer( mLayer );
290}
291
293{
294 QString msg;
295 bool defaultLoadedFlag = false;
296
297 const QgsDataProvider *provider = mLayer->dataProvider();
298 if ( !provider )
299 return;
301 {
302 QMessageBox askToUser;
303 askToUser.setText( tr( "Load default style from: " ) );
304 askToUser.setIcon( QMessageBox::Question );
305 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
306 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
307 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
308
309 switch ( askToUser.exec() )
310 {
311 case 0:
312 return;
313 case 2:
314 msg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, false );
315 if ( !defaultLoadedFlag )
316 {
317 //something went wrong - let them know why
318 QMessageBox::information( this, tr( "Default Style" ), msg );
319 }
320 if ( msg.compare( tr( "Loaded from Provider" ) ) )
321 {
322 QMessageBox::information( this, tr( "Default Style" ),
323 tr( "No default style was found for this layer." ) );
324 }
325 else
326 {
327 syncToLayer();
328 apply();
329 }
330
331 return;
332 default:
333 break;
334 }
335 }
336
337 QString myMessage = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true );
338 // QString myMessage = layer->loadDefaultStyle( defaultLoadedFlag );
339 //reset if the default style was loaded OK only
340 if ( defaultLoadedFlag )
341 {
342 // all worked OK so no need to inform user
343 syncToLayer();
344 apply();
345 }
346 else
347 {
348 //something went wrong - let them know why
349 QMessageBox::information( this, tr( "Default Style" ), myMessage );
350 }
351}
352
354{
355 QString errorMsg;
356 const QgsDataProvider *provider = mLayer->dataProvider();
357 if ( !provider )
358 return;
360 {
361 QMessageBox askToUser;
362 askToUser.setText( tr( "Save default style to: " ) );
363 askToUser.setIcon( QMessageBox::Question );
364 askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
365 askToUser.addButton( tr( "Local Database" ), QMessageBox::NoRole );
366 askToUser.addButton( tr( "Datasource Database" ), QMessageBox::YesRole );
367
368 switch ( askToUser.exec() )
369 {
370 case 0:
371 return;
372 case 2:
373 {
374 apply();
375 QString errorMessage;
376 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), QString(), errorMessage ) )
377 {
378 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
379 QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
380 QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
381 {
382 return;
383 }
384 }
385 else if ( !errorMessage.isEmpty() )
386 {
387 QMessageBox::warning( nullptr, QObject::tr( "Save style in database" ),
388 errorMessage );
389 return;
390 }
391
392 mLayer->saveStyleToDatabase( QString(), QString(), true, QString(), errorMsg );
393 if ( errorMsg.isNull() )
394 {
395 return;
396 }
397 break;
398 }
399 default:
400 break;
401 }
402 }
403
405}
406
408{
409 if ( !mLayer->dataProvider() )
410 return;
411 QgsMapLayerSaveStyleDialog dlg( mLayer );
412
413 if ( dlg.exec() )
414 {
415 apply();
416
417 bool defaultLoadedFlag = false;
418 QString errorMessage;
419
420 StyleType type = dlg.currentStyleType();
421 switch ( type )
422 {
423 case QML:
424 case SLD:
425 {
426 QString filePath = dlg.outputFilePath();
427 if ( type == QML )
428 errorMessage = mLayer->saveNamedStyle( filePath, defaultLoadedFlag, dlg.styleCategories() );
429 else
430 {
432 errorMessage = mLayer->saveSldStyleV2( defaultLoadedFlag, sldContext );
433 }
434
435 //reset if the default style was loaded OK only
436 if ( defaultLoadedFlag )
437 {
438 syncToLayer();
439 }
440 else
441 {
442 //let the user know what went wrong
443 QMessageBox::information( this, tr( "Save Style" ), errorMessage );
444 }
445
446 break;
447 }
449 {
450 QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
451
453
454 if ( QgsProviderRegistry::instance()->styleExists( mLayer->providerType(), mLayer->source(), dbSettings.name, errorMessage ) )
455 {
456 if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
457 QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
458 QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
459 {
460 return;
461 }
462 }
463 else if ( !errorMessage.isEmpty() )
464 {
465 QMessageBox::warning( this, infoWindowTitle, errorMessage );
466 return;
467 }
468
469 mLayer->saveStyleToDatabase( dbSettings.name, dbSettings.description, dbSettings.isDefault, dbSettings.uiFileContent, errorMessage, dlg.styleCategories() );
470
471 if ( !errorMessage.isNull() )
472 {
473 QMessageBox::warning( this, infoWindowTitle, errorMessage );
474 }
475 else
476 {
477 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
478 }
479 break;
480 }
481 case UserDatabase:
482 {
483 QString infoWindowTitle = tr( "Save default style to local database" );
484 errorMessage = mLayer->saveDefaultStyle( defaultLoadedFlag, dlg.styleCategories() );
485 if ( !defaultLoadedFlag )
486 {
487 QMessageBox::warning( this, infoWindowTitle, errorMessage );
488 }
489 else
490 {
491 QMessageBox::information( this, infoWindowTitle, tr( "Style saved" ) );
492 }
493 break;
494 }
495 }
496 }
497}
498
500{
501 QString errorMsg;
502 QStringList ids, names, descriptions;
503
504 //get the list of styles in the db
505 int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg );
506 QgsMapLayerLoadStyleDialog dlg( mLayer, this );
507 dlg.initializeLists( ids, names, descriptions, sectionLimit );
508
509 if ( dlg.exec() )
510 {
511 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
513 StyleType type = dlg.currentStyleType();
514 bool defaultLoadedFlag = false;
515 switch ( type )
516 {
517 case QML:
518 case SLD:
519 {
520 QString filePath = dlg.filePath();
521 if ( type == SLD )
522 {
523 errorMsg = mLayer->loadSldStyle( filePath, defaultLoadedFlag );
524 }
525 else
526 {
527 errorMsg = mLayer->loadNamedStyle( filePath, defaultLoadedFlag, true, categories );
528 }
529 //reset if the default style was loaded OK only
530 if ( defaultLoadedFlag )
531 {
532 syncToLayer();
533 apply();
534 }
535 else
536 {
537 //let the user know what went wrong
538 QMessageBox::warning( this, tr( "Load Style" ), errorMsg );
539 }
540 break;
541 }
543 {
544 QString selectedStyleId = dlg.selectedStyleId();
545
546 QString qmlStyle = mLayer->getStyleFromDatabase( selectedStyleId, errorMsg );
547 if ( !errorMsg.isNull() )
548 {
549 QMessageBox::warning( this, tr( "Load Styles from Database" ), errorMsg );
550 return;
551 }
552
553 QDomDocument myDocument( QStringLiteral( "qgis" ) );
554 myDocument.setContent( qmlStyle );
555
556 if ( mLayer->importNamedStyle( myDocument, errorMsg, categories ) )
557 {
558 syncToLayer();
559 apply();
560 }
561 else
562 {
563 QMessageBox::warning( this, tr( "Load Styles from Database" ),
564 tr( "The retrieved style is not a valid named style. Error message: %1" )
565 .arg( errorMsg ) );
566 }
567 break;
568 }
569 case UserDatabase:
570 {
571 errorMsg = mLayer->loadNamedStyle( mLayer->styleURI(), defaultLoadedFlag, true, categories );
572 //reset if the default style was loaded OK only
573 if ( defaultLoadedFlag )
574 {
575 syncToLayer();
576 apply();
577 }
578 else
579 {
580 QMessageBox::warning( this, tr( "Load Default Style" ), errorMsg );
581 }
582 break;
583 }
584 }
585 activateWindow(); // set focus back to properties dialog
586 }
587}
588
590{
591 if ( !mLayer )
592 return;
593
594 mOldStyle = mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() );
595}
596
597QString QgsLayerPropertiesDialog::generateDialogTitle() const
598{
599 QString title = tr( "Layer Properties - %1" ).arg( mLayer->name() );
600
601 if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
602 title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
603
604 return title;
605}
606
608{
609 if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
610 {
611 // need to reset style to previous - style applied directly to the layer (not in apply())
612 QString message;
613 QDomDocument doc( QStringLiteral( "qgis" ) );
614 int errorLine, errorColumn;
615 doc.setContent( mOldStyle.xmlData(), false, &message, &errorLine, &errorColumn );
616 mLayer->importNamedStyle( doc, message );
617 syncToLayer();
618 }
619}
620
622{
624
625 if ( mMetadataPage && mBtnStyle && mBtnMetadata )
626 {
627 const bool isMetadataPanel = ( index == mOptStackedWidget->indexOf( mMetadataPage ) );
628 mBtnStyle->setVisible( ! isMetadataPanel );
629 mBtnMetadata->setVisible( isMetadataPanel );
630 }
631}
632
634{
635 QFileInfo file( url.toLocalFile() );
636 if ( file.exists() && !file.isDir() )
637 QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( url.toLocalFile() );
638 else
639 QDesktopServices::openUrl( url );
640}
@ 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:84
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:6535
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:6534