QGIS API Documentation  2.99.0-Master (7d4f81d)
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QgsOptionsDialogBase Class Reference

A base dialog for options and properties dialogs that offers vertical tabs. More...

#include <qgsoptionsdialogbase.h>

Inheritance diagram for QgsOptionsDialogBase:
Inheritance graph
[legend]

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=0, QgsSettings *settings=nullptr)
 Constructor. More...
 
 ~QgsOptionsDialogBase ()
 
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

void optionsStackedWidget_CurrentChanged (int indx)
 
void optionsStackedWidget_WidgetRemoved (int indx)
 
void updateOptionsListVerticalTabs ()
 
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< QgsSearchHighlightOptionWidget *, int > > mRegisteredSearchWidgets
 
QgsFilterLineEditmSearchLineEdit = nullptr
 
QPointer< QgsSettingsmSettings
 

Detailed Description

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 110 of file qgsoptionsdialogbase.h.

Constructor & Destructor Documentation

◆ QgsOptionsDialogBase()

QgsOptionsDialogBase::QgsOptionsDialogBase ( const QString &  settingsKey,
QWidget *  parent = nullptr,
Qt::WindowFlags  fl = 0,
QgsSettings settings = nullptr 
)

Constructor.

Parameters
settingsKeyQgsSettings subgroup key for saving/restore ui states, e.g. "ProjectProperties".
parentparent object (owner)
flwidget flags
settingscustom QgsSettings pointer

Definition at line 41 of file qgsoptionsdialogbase.cpp.

◆ ~QgsOptionsDialogBase()

QgsOptionsDialogBase::~QgsOptionsDialogBase ( )

Definition at line 57 of file qgsoptionsdialogbase.cpp.

Member Function Documentation

◆ iconOnly()

bool QgsOptionsDialogBase::iconOnly ( )
inline

Determine if the options list is in icon only mode.

Definition at line 142 of file qgsoptionsdialogbase.h.

◆ initOptionsBase()

void QgsOptionsDialogBase::initOptionsBase ( bool  restoreUi = true,
const QString &  title = QString() 
)

Set up the base ui connections for vertical tabs.

Parameters
restoreUiWhether to restore the base ui at this time.
titlethe window title

Definition at line 74 of file qgsoptionsdialogbase.cpp.

◆ optionsStackedWidget_CurrentChanged

void QgsOptionsDialogBase::optionsStackedWidget_CurrentChanged ( int  indx)
protectedslot

Definition at line 365 of file qgsoptionsdialogbase.cpp.

◆ optionsStackedWidget_WidgetRemoved

void QgsOptionsDialogBase::optionsStackedWidget_WidgetRemoved ( int  indx)
protectedslot

Definition at line 374 of file qgsoptionsdialogbase.cpp.

◆ paintEvent()

void QgsOptionsDialogBase::paintEvent ( QPaintEvent *  e)
overrideprotected

Definition at line 308 of file qgsoptionsdialogbase.cpp.

◆ registerTextSearchWidgets()

void QgsOptionsDialogBase::registerTextSearchWidgets ( )
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.

Since
QGIS 3.0

Definition at line 266 of file qgsoptionsdialogbase.cpp.

◆ restoreOptionsBaseUi()

void QgsOptionsDialogBase::restoreOptionsBaseUi ( const QString &  title = QString())

Restore the base ui.

Sometimes useful to do at end of subclass's constructor.

Parameters
titlethe window title (it does not need to be defined if previously given to initOptionsBase();

Definition at line 169 of file qgsoptionsdialogbase.cpp.

◆ searchText

void QgsOptionsDialogBase::searchText ( const QString &  text)
slot

searchText searches for a text in all the pages of the stacked widget and highlight the results

Parameters
textthe text to search
Since
QGIS 3.0

Definition at line 218 of file qgsoptionsdialogbase.cpp.

◆ setSettings()

void QgsOptionsDialogBase::setSettings ( QgsSettings settings)

Definition at line 158 of file qgsoptionsdialogbase.cpp.

◆ showEvent()

void QgsOptionsDialogBase::showEvent ( QShowEvent *  e)
overrideprotected

Definition at line 288 of file qgsoptionsdialogbase.cpp.

◆ updateOptionsListVerticalTabs

void QgsOptionsDialogBase::updateOptionsListVerticalTabs ( )
protectedslot

Definition at line 329 of file qgsoptionsdialogbase.cpp.

◆ updateWindowTitle()

void QgsOptionsDialogBase::updateWindowTitle ( )
protectedvirtual

Definition at line 316 of file qgsoptionsdialogbase.cpp.

◆ warnAboutMissingObjects

void QgsOptionsDialogBase::warnAboutMissingObjects ( )
protectedslot

Definition at line 389 of file qgsoptionsdialogbase.cpp.

Member Data Documentation

◆ mDelSettings

bool QgsOptionsDialogBase::mDelSettings
protected

Definition at line 186 of file qgsoptionsdialogbase.h.

◆ mDialogTitle

QString QgsOptionsDialogBase::mDialogTitle
protected

Definition at line 181 of file qgsoptionsdialogbase.h.

◆ mIconOnly

bool QgsOptionsDialogBase::mIconOnly
protected

Definition at line 182 of file qgsoptionsdialogbase.h.

◆ mInit

bool QgsOptionsDialogBase::mInit
protected

Definition at line 175 of file qgsoptionsdialogbase.h.

◆ mOptButtonBox

QDialogButtonBox* QgsOptionsDialogBase::mOptButtonBox = nullptr
protected

Definition at line 179 of file qgsoptionsdialogbase.h.

◆ mOptListWidget

QListWidget* QgsOptionsDialogBase::mOptListWidget = nullptr
protected

Definition at line 176 of file qgsoptionsdialogbase.h.

◆ mOptsKey

QString QgsOptionsDialogBase::mOptsKey
protected

Definition at line 174 of file qgsoptionsdialogbase.h.

◆ mOptSplitter

QSplitter* QgsOptionsDialogBase::mOptSplitter = nullptr
protected

Definition at line 178 of file qgsoptionsdialogbase.h.

◆ mOptStackedWidget

QStackedWidget* QgsOptionsDialogBase::mOptStackedWidget = nullptr
protected

Definition at line 177 of file qgsoptionsdialogbase.h.

◆ mRegisteredSearchWidgets

QList< QPair< QgsSearchHighlightOptionWidget *, int > > QgsOptionsDialogBase::mRegisteredSearchWidgets
protected

Definition at line 172 of file qgsoptionsdialogbase.h.

◆ mSearchLineEdit

QgsFilterLineEdit* QgsOptionsDialogBase::mSearchLineEdit = nullptr
protected

Definition at line 180 of file qgsoptionsdialogbase.h.

◆ mSettings

QPointer<QgsSettings> QgsOptionsDialogBase::mSettings
protected

Definition at line 185 of file qgsoptionsdialogbase.h.


The documentation for this class was generated from the following files: