CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkSettingsDialog Class Reference

#include <Libs/Widgets/ctkSettingsDialog.h>

Inheritance diagram for ctkSettingsDialog:
Inheritance graph
[legend]
Collaboration diagram for ctkSettingsDialog:
Collaboration graph
[legend]

Public Types

typedef QDialog Superclass
 Superclass typedef. More...
 

Public Slots

virtual void accept ()
 
void adjustTreeWidgetToContents ()
 Resize the left panel based on the panels titles. More...
 
void applySettings ()
 
virtual void reject ()
 
void reloadSettings ()
 
void resetSettings ()
 
void restoreDefaultSettings ()
 
void setCurrentPanel (ctkSettingsPanel *panel)
 
void setCurrentPanel (const QString &label)
 

Signals

void restartRequested ()
 
void settingChanged (const QString &key, const QVariant &value)
 

Public Member Functions

Q_INVOKABLE void addPanel (ctkSettingsPanel *panel, ctkSettingsPanel *parentPanel=0)
 
Q_INVOKABLE void addPanel (const QString &label, ctkSettingsPanel *panel, ctkSettingsPanel *parentPanel=0)
 
Q_INVOKABLE void addPanel (const QString &label, const QIcon &icon, ctkSettingsPanel *panel, ctkSettingsPanel *parentPanel=0)
 
 ctkSettingsDialog (QWidget *parent=0)
 Constructor. More...
 
ctkSettingsPanelcurrentPanel () const
 
bool isRestartRequired () const
 
ctkSettingsPanelpanel (const QString &panel) const
 
bool resetButton () const
 
void setResetButton (bool show)
 
void setSettings (QSettings *settings)
 
QSettings * settings () const
 
virtual ~ctkSettingsDialog ()
 Destructor. More...
 

Protected Slots

void onCurrentItemChanged (QTreeWidgetItem *currentItem, QTreeWidgetItem *previous)
 
void onDialogButtonClicked (QAbstractButton *button)
 
void onSettingChanged (const QString &key, const QVariant &newVal)
 

Protected Member Functions

virtual bool event (QEvent *)
 

Protected Attributes

QScopedPointer< ctkSettingsDialogPrivate > d_ptr
 

Properties

ctkSettingsPanel currentPanel
 
bool resetButton
 
bool restartRequired
 
QSettings settings
 

Detailed Description

Definition at line 37 of file ctkSettingsDialog.h.

Member Typedef Documentation

Superclass typedef.

Definition at line 54 of file ctkSettingsDialog.h.

Constructor & Destructor Documentation

ctkSettingsDialog::ctkSettingsDialog ( QWidget *  parent = 0)
explicit

Constructor.

virtual ctkSettingsDialog::~ctkSettingsDialog ( )
virtual

Destructor.

Member Function Documentation

virtual void ctkSettingsDialog::accept ( )
virtualslot
Q_INVOKABLE void ctkSettingsDialog::addPanel ( ctkSettingsPanel panel,
ctkSettingsPanel parentPanel = 0 
)

Add settings panel to the dialog.

This adds the specified settings panel to the dialog. The panel's QWidget::windowTitle property is used as the panel name as shown in the panels list.

Q_INVOKABLE void ctkSettingsDialog::addPanel ( const QString &  label,
ctkSettingsPanel panel,
ctkSettingsPanel parentPanel = 0 
)

This convenience overload allows the caller to specify the panel name that will be used in the panels list.

Q_INVOKABLE void ctkSettingsDialog::addPanel ( const QString &  label,
const QIcon &  icon,
ctkSettingsPanel panel,
ctkSettingsPanel parentPanel = 0 
)

This convenience overload allows the caller to specify the panel name that will be used in the panels list, as well as an icon for the panel.

void ctkSettingsDialog::adjustTreeWidgetToContents ( )
slot

Resize the left panel based on the panels titles.

void ctkSettingsDialog::applySettings ( )
slot
ctkSettingsPanel* ctkSettingsDialog::currentPanel ( ) const
virtual bool ctkSettingsDialog::event ( QEvent *  )
protectedvirtual
bool ctkSettingsDialog::isRestartRequired ( ) const
void ctkSettingsDialog::onCurrentItemChanged ( QTreeWidgetItem *  currentItem,
QTreeWidgetItem *  previous 
)
protectedslot
void ctkSettingsDialog::onDialogButtonClicked ( QAbstractButton *  button)
protectedslot
void ctkSettingsDialog::onSettingChanged ( const QString &  key,
const QVariant &  newVal 
)
protectedslot
ctkSettingsPanel* ctkSettingsDialog::panel ( const QString &  panel) const
virtual void ctkSettingsDialog::reject ( )
virtualslot
void ctkSettingsDialog::reloadSettings ( )
slot

Reload settings for all registered panels.

This reloads the settings for all panels, effectively throwing out any values in the UI or the panels' caches and reverting to the values in the associated QSettings. You should call this if you have made changes to the QSettings that were not made through ctkSettingsPanel.

bool ctkSettingsDialog::resetButton ( ) const
void ctkSettingsDialog::resetSettings ( )
slot
void ctkSettingsDialog::restartRequested ( )
signal

Signal fired when the user accepts to restart the application because some OptionRestartRequired settings have changed.

See also
isrestartRequired
void ctkSettingsDialog::restoreDefaultSettings ( )
slot
void ctkSettingsDialog::setCurrentPanel ( ctkSettingsPanel panel)
slot
void ctkSettingsDialog::setCurrentPanel ( const QString &  label)
slot
void ctkSettingsDialog::setResetButton ( bool  show)
void ctkSettingsDialog::setSettings ( QSettings *  settings)
void ctkSettingsDialog::settingChanged ( const QString &  key,
const QVariant &  value 
)
signal
QSettings* ctkSettingsDialog::settings ( ) const

Member Data Documentation

QScopedPointer<ctkSettingsDialogPrivate> ctkSettingsDialog::d_ptr
protected

Definition at line 138 of file ctkSettingsDialog.h.

Property Documentation

ctkSettingsPanel ctkSettingsDialog::currentPanel
readwrite

Definition at line 45 of file ctkSettingsDialog.h.

bool ctkSettingsDialog::resetButton
readwrite

This property controls whether the reset button is visible in the button box or not. The Cancel button is a reset button and closes the dialog at the same time.

Definition at line 43 of file ctkSettingsDialog.h.

bool ctkSettingsDialog::restartRequired
read

Specifies if a restart required to fully apply changes.

This property is true if at least one OptionRestartRequired setting is changed. It doesn't imply that the user accepted to restart the application.

Definition at line 47 of file ctkSettingsDialog.h.

QSettings ctkSettingsDialog::settings
readwrite

Definition at line 43 of file ctkSettingsDialog.h.


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