QGIS API Documentation  2.99.0-Master (0a63d1f)
qgsoptionsdialogbase.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsoptionsdialogbase.h - base vertical tabs option dialog
3 
4  ---------------------
5  begin : March 24, 2013
6  copyright : (C) 2013 by Larry Shaffer
7  email : larrys at dakcarto dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSOPTIONSDIALOGBASE_H
18 #define QGSOPTIONSDIALOGBASE_H
19 
20 #include "qgisgui.h"
21 
22 #include <QDialog>
23 #include <QPointer>
24 #include <QSettings>
25 #include "qgis_gui.h"
26 
27 class QDialogButtonBox;
28 class QListWidget;
29 class QStackedWidget;
30 class QSplitter;
31 
49 class GUI_EXPORT QgsOptionsDialogBase : public QDialog
50 {
51  Q_OBJECT
52 
53  public:
54 
61  QgsOptionsDialogBase( const QString& settingsKey, QWidget* parent = nullptr, Qt::WindowFlags fl = 0, QSettings* settings = nullptr );
63 
68  void initOptionsBase( bool restoreUi = true, const QString& title = QString() );
69 
70  // set custom QSettings pointer if dialog used outside QGIS (in plugin)
71  void setSettings( QSettings* settings );
72 
77  void restoreOptionsBaseUi( const QString& title = QString() );
78 
81  bool iconOnly() {return mIconOnly;}
82 
83  protected slots:
84  void updateOptionsListVerticalTabs();
85  void optionsStackedWidget_CurrentChanged( int indx );
86  void optionsStackedWidget_WidgetRemoved( int indx );
87  void warnAboutMissingObjects();
88 
89  protected:
90  void showEvent( QShowEvent* e ) override;
91  void paintEvent( QPaintEvent* e ) override;
92 
93  virtual void updateWindowTitle();
94 
95  QString mOptsKey;
96  bool mInit;
97  QListWidget* mOptListWidget;
98  QStackedWidget* mOptStackedWidget;
99  QSplitter* mOptSplitter;
100  QDialogButtonBox* mOptButtonBox;
101  QString mDialogTitle;
102  bool mIconOnly;
103  // pointer to app or custom, external QSettings
104  // QPointer in case custom settings obj gets deleted while dialog is open
105  QPointer<QSettings> mSettings;
107 };
108 
109 #endif // QGSOPTIONSDIALOGBASE_H
A base dialog for options and properties dialogs that offers vertical tabs.
QDialogButtonBox * mOptButtonBox
QStackedWidget * mOptStackedWidget
bool iconOnly()
Determine if the options list is in icon only mode.
QPointer< QSettings > mSettings