QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
26 class QDialogButtonBox;
27 class QListWidget;
28 class QStackedWidget;
29 class QSplitter;
30 
48 class GUI_EXPORT QgsOptionsDialogBase : public QDialog
49 {
50  Q_OBJECT
51 
52  public:
59  QgsOptionsDialogBase( QString settingsKey, QWidget* parent = 0, Qt::WindowFlags fl = 0, QSettings* settings = 0 );
61 
66  void initOptionsBase( bool restoreUi = true, QString title = QString() );
67 
68  // set custom QSettings pointer if dialog used outside QGIS (in plugin)
69  void setSettings( QSettings* settings );
70 
75  void restoreOptionsBaseUi( QString title = QString() );
76 
79  bool iconOnly() {return mIconOnly;}
80 
81  protected slots:
82  void updateOptionsListVerticalTabs();
83  void optionsStackedWidget_CurrentChanged( int indx );
84  void optionsStackedWidget_WidgetRemoved( int indx );
85  void warnAboutMissingObjects();
86 
87  protected:
88  void showEvent( QShowEvent* e );
89  void paintEvent( QPaintEvent* e );
90 
91  virtual void updateWindowTitle();
92 
93  QString mOptsKey;
94  bool mInit;
95  QListWidget* mOptListWidget;
96  QStackedWidget* mOptStackedWidget;
97  QSplitter* mOptSplitter;
98  QDialogButtonBox* mOptButtonBox;
99  QString mDialogTitle;
100  bool mIconOnly;
101  // pointer to app or custom, external QSettings
102  // QPointer in case custom settings obj gets deleted while dialog is open
103  QPointer<QSettings> mSettings;
105 };
106 
107 #endif // QGSOPTIONSDIALOGBASE_H