QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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>

Public Member Functions

 QgsOptionsDialogBase (QString settingsKey, QWidget *parent=0, Qt::WFlags fl=0)
 Constructor.
 ~QgsOptionsDialogBase ()
void initOptionsBase (bool restoreUi=true)
 Set up the base ui connections for vertical tabs.
void restoreOptionsBaseUi ()
 Restore the base ui.

Protected Slots

void updateOptionsListVerticalTabs ()
void optionsStackedWidget_CurrentChanged (int indx)
void optionsStackedWidget_WidgetRemoved (int indx)
void warnAboutMissingObjects ()

Protected Member Functions

void showEvent (QShowEvent *e)
void paintEvent (QPaintEvent *e)

Protected Attributes

QString mOptsKey
bool mInit
QListWidget * mOptListWidget
QStackedWidget * mOptStackedWidget
QSplitter * mOptSplitter
QDialogButtonBox * mOptButtonBox

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

Note
added in 1.9

Definition at line 47 of file qgsoptionsdialogbase.h.

Constructor & Destructor Documentation

QgsOptionsDialogBase::QgsOptionsDialogBase ( QString  settingsKey,
QWidget *  parent = 0,
Qt::WFlags  fl = 0 
)

Constructor.

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

Definition at line 31 of file qgsoptionsdialogbase.cpp.

QgsOptionsDialogBase::~QgsOptionsDialogBase ( )

Definition at line 36 of file qgsoptionsdialogbase.cpp.

References mInit, mOptsKey, mOptSplitter, and mOptStackedWidget.

Member Function Documentation

void QgsOptionsDialogBase::initOptionsBase ( bool  restoreUi = true)

Set up the base ui connections for vertical tabs.

Parameters
restoreUiWhether to restore the base ui at this time.

Definition at line 47 of file qgsoptionsdialogbase.cpp.

References mInit, mOptButtonBox, mOptListWidget, mOptSplitter, mOptStackedWidget, optionsStackedWidget_CurrentChanged(), optionsStackedWidget_WidgetRemoved(), restoreOptionsBaseUi(), and updateOptionsListVerticalTabs().

void QgsOptionsDialogBase::optionsStackedWidget_CurrentChanged ( int  indx)
protectedslot

Definition at line 180 of file qgsoptionsdialogbase.cpp.

References mOptListWidget.

Referenced by initOptionsBase().

void QgsOptionsDialogBase::optionsStackedWidget_WidgetRemoved ( int  indx)
protectedslot

Definition at line 187 of file qgsoptionsdialogbase.cpp.

References mOptListWidget.

Referenced by initOptionsBase().

void QgsOptionsDialogBase::paintEvent ( QPaintEvent *  e)
protected

Definition at line 138 of file qgsoptionsdialogbase.cpp.

References mInit, and updateOptionsListVerticalTabs().

void QgsOptionsDialogBase::restoreOptionsBaseUi ( )

Restore the base ui.

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

Definition at line 83 of file qgsoptionsdialogbase.cpp.

References mInit, mOptListWidget, mOptsKey, mOptSplitter, and mOptStackedWidget.

Referenced by initOptionsBase().

void QgsOptionsDialogBase::showEvent ( QShowEvent *  e)
protected
void QgsOptionsDialogBase::updateOptionsListVerticalTabs ( )
protectedslot

Definition at line 146 of file qgsoptionsdialogbase.cpp.

References mInit, mOptListWidget, and mOptSplitter.

Referenced by initOptionsBase(), paintEvent(), and showEvent().

void QgsOptionsDialogBase::warnAboutMissingObjects ( )
protectedslot

Definition at line 193 of file qgsoptionsdialogbase.cpp.

References tr.

Referenced by showEvent().

Member Data Documentation

bool QgsOptionsDialogBase::mInit
protected
QDialogButtonBox* QgsOptionsDialogBase::mOptButtonBox
protected

Definition at line 85 of file qgsoptionsdialogbase.h.

Referenced by initOptionsBase().

QListWidget* QgsOptionsDialogBase::mOptListWidget
protected
QString QgsOptionsDialogBase::mOptsKey
protected

Definition at line 80 of file qgsoptionsdialogbase.h.

Referenced by restoreOptionsBaseUi(), and ~QgsOptionsDialogBase().

QSplitter* QgsOptionsDialogBase::mOptSplitter
protected
QStackedWidget* QgsOptionsDialogBase::mOptStackedWidget
protected

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