QGIS API Documentation
3.8.0-Zanzibar (11aff65)
|
A base dialog for options and properties dialogs that offers vertical tabs. More...
#include <qgsoptionsdialogbase.h>
Public Slots | |
void | searchText (const QString &text) |
searchText searches for a text in all the pages of the stacked widget and highlight the results More... | |
Public Member Functions | |
QgsOptionsDialogBase (const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=nullptr, QgsSettings *settings=nullptr) | |
Constructor. More... | |
~QgsOptionsDialogBase () override | |
bool | iconOnly () |
Determine if the options list is in icon only mode. More... | |
void | initOptionsBase (bool restoreUi=true, const QString &title=QString()) |
Set up the base ui connections for vertical tabs. More... | |
void | restoreOptionsBaseUi (const QString &title=QString()) |
Restore the base ui. More... | |
void | setSettings (QgsSettings *settings) |
Protected Slots | |
virtual void | optionsStackedWidget_CurrentChanged (int index) |
Select relevant tab on current page change. More... | |
virtual void | optionsStackedWidget_WidgetRemoved (int index) |
Remove tab and unregister widgets on page remove. More... | |
virtual void | updateOptionsListVerticalTabs () |
Update tabs on the splitter move. More... | |
void | warnAboutMissingObjects () |
Protected Member Functions | |
void | paintEvent (QPaintEvent *e) override |
void | registerTextSearchWidgets () |
register widgets in the dialog to search for text in it it is automatically called if a line edit has "mSearchLineEdit" as object name. More... | |
void | showEvent (QShowEvent *e) override |
virtual void | updateWindowTitle () |
Protected Attributes | |
bool | mDelSettings |
QString | mDialogTitle |
bool | mIconOnly |
bool | mInit |
QDialogButtonBox * | mOptButtonBox = nullptr |
QListWidget * | mOptListWidget = nullptr |
QString | mOptsKey |
QSplitter * | mOptSplitter = nullptr |
QStackedWidget * | mOptStackedWidget = nullptr |
QList< QPair< QgsOptionsDialogHighlightWidget *, int > > | mRegisteredSearchWidgets |
QgsFilterLineEdit * | mSearchLineEdit = nullptr |
QPointer< QgsSettings > | mSettings |
A base dialog for options and properties dialogs that offers vertical tabs.
It handles saving/restoring of geometry, splitter and current tab states, switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left), and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
To use: 1) Start with copy of qgsoptionsdialog_template.ui and build options/properties dialog. 2) In source file for dialog, inherit this class instead of QDialog, then in constructor: ... setupUi( this ); // set up .ui file objects initOptionsBase( false
); // set up this class to use .ui objects, optionally restoring base ui ... restoreOptionsBaseUi(); // restore the base ui with initOptionsBase or use this later on
Definition at line 61 of file qgsoptionsdialogbase.h.
QgsOptionsDialogBase::QgsOptionsDialogBase | ( | const QString & | settingsKey, |
QWidget * | parent = nullptr , |
||
Qt::WindowFlags | fl = nullptr , |
||
QgsSettings * | settings = nullptr |
||
) |
Constructor.
settingsKey | QgsSettings subgroup key for saving/restore ui states, e.g. "ProjectProperties". |
parent | parent object (owner) |
fl | widget flags |
settings | custom QgsSettings pointer |
Definition at line 37 of file qgsoptionsdialogbase.cpp.
|
override |
Definition at line 47 of file qgsoptionsdialogbase.cpp.
|
inline |
Determine if the options list is in icon only mode.
Definition at line 97 of file qgsoptionsdialogbase.h.
void QgsOptionsDialogBase::initOptionsBase | ( | bool | restoreUi = true , |
const QString & | title = QString() |
||
) |
Set up the base ui connections for vertical tabs.
restoreUi | Whether to restore the base ui at this time. |
title | the window title |
Definition at line 64 of file qgsoptionsdialogbase.cpp.
|
protectedvirtualslot |
Select relevant tab on current page change.
Definition at line 371 of file qgsoptionsdialogbase.cpp.
|
protectedvirtualslot |
Remove tab and unregister widgets on page remove.
Definition at line 380 of file qgsoptionsdialogbase.cpp.
|
overrideprotected |
Definition at line 314 of file qgsoptionsdialogbase.cpp.
|
protected |
register widgets in the dialog to search for text in it it is automatically called if a line edit has "mSearchLineEdit" as object name.
Definition at line 253 of file qgsoptionsdialogbase.cpp.
void QgsOptionsDialogBase::restoreOptionsBaseUi | ( | const QString & | title = QString() | ) |
Restore the base ui.
Sometimes useful to do at end of subclass's constructor.
title | the window title (it does not need to be defined if previously given to initOptionsBase(); |
Definition at line 159 of file qgsoptionsdialogbase.cpp.
|
slot |
searchText searches for a text in all the pages of the stacked widget and highlight the results
text | the text to search |
Definition at line 208 of file qgsoptionsdialogbase.cpp.
void QgsOptionsDialogBase::setSettings | ( | QgsSettings * | settings | ) |
Definition at line 148 of file qgsoptionsdialogbase.cpp.
|
overrideprotected |
Definition at line 294 of file qgsoptionsdialogbase.cpp.
|
protectedvirtualslot |
Update tabs on the splitter move.
Definition at line 335 of file qgsoptionsdialogbase.cpp.
|
protectedvirtual |
Definition at line 322 of file qgsoptionsdialogbase.cpp.
|
protectedslot |
Definition at line 395 of file qgsoptionsdialogbase.cpp.
|
protected |
Definition at line 145 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 140 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 141 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 134 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 138 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 135 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 133 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 137 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 136 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 131 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 139 of file qgsoptionsdialogbase.h.
|
protected |
Definition at line 144 of file qgsoptionsdialogbase.h.