QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 "qgsguiutils.h"
21 #include "qgssettings.h"
22 #include "qgis_gui.h"
23 
24 #include <functional>
25 
26 #include <QDialog>
27 #include <QPointer>
28 #include <QStyledItemDelegate>
29 
30 class QDialogButtonBox;
31 class QListWidget;
32 class QModelIndex;
33 class QPalette;
34 class QPainter;
35 class QStackedWidget;
36 class QStyleOptionViewItem;
37 class QSplitter;
38 
39 class QgsFilterLineEdit;
41 
42 
61 class GUI_EXPORT QgsOptionsDialogBase : public QDialog
62 {
63  Q_OBJECT
64 
65  public:
66 
74  QgsOptionsDialogBase( const QString &settingsKey, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = nullptr, QgsSettings *settings = nullptr );
75  ~QgsOptionsDialogBase() override;
76 
82  void initOptionsBase( bool restoreUi = true, const QString &title = QString() );
83 
84  // set custom QgsSettings pointer if dialog used outside QGIS (in plugin)
85  void setSettings( QgsSettings *settings );
86 
92  void restoreOptionsBaseUi( const QString &title = QString() );
93 
99  void resizeAlltabs( int index );
100 
104  bool iconOnly() {return mIconOnly;}
105 
106  public slots:
107 
113  void searchText( const QString &text );
114 
115  protected slots:
117  virtual void updateOptionsListVerticalTabs();
119  virtual void optionsStackedWidget_CurrentChanged( int index );
121  virtual void optionsStackedWidget_WidgetRemoved( int index );
122 
123  void warnAboutMissingObjects();
124 
125  protected:
126  void showEvent( QShowEvent *e ) override;
127  void paintEvent( QPaintEvent *e ) override;
128 
129  virtual void updateWindowTitle();
130 
136  void registerTextSearchWidgets();
137 
138  QList< QPair< QgsOptionsDialogHighlightWidget *, int > > mRegisteredSearchWidgets;
139 
140  QString mOptsKey;
141  bool mInit;
142  QListWidget *mOptListWidget = nullptr;
143  QStackedWidget *mOptStackedWidget = nullptr;
144  QSplitter *mOptSplitter = nullptr;
145  QDialogButtonBox *mOptButtonBox = nullptr;
146  QgsFilterLineEdit *mSearchLineEdit = nullptr;
147  QString mDialogTitle;
148  bool mIconOnly;
149  // pointer to app or custom, external QgsSettings
150  // QPointer in case custom settings obj gets deleted while dialog is open
151  QPointer<QgsSettings> mSettings;
153 };
154 
155 #endif // QGSOPTIONSDIALOGBASE_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
This class is a composition of two QSettings instances:
Definition: qgssettings.h:58
QList< QPair< QgsOptionsDialogHighlightWidget *, int > > mRegisteredSearchWidgets
QLineEdit subclass with built in support for clearing the widget&#39;s value and handling custom null val...
A base dialog for options and properties dialogs that offers vertical tabs.
Container for a widget to be used to search text in the option dialog If the widget type is handled...
QPointer< QgsSettings > mSettings
bool iconOnly()
Determine if the options list is in icon only mode.