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 | Public Member Functions | Static Public Member Functions | Protected Attributes | Properties | List of all members
ctkMessageBox Class Reference

#include <Libs/Widgets/ctkMessageBox.h>

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

Public Types

typedef QMessageBox Superclass
 

Public Slots

void setDontShowAgain (bool dontShow)
 Change the checkbox and the settings if any. More...
 

Public Member Functions

 ctkMessageBox (Icon icon, const QString &title, const QString &text, StandardButtons buttons=NoButton, QWidget *parent=0, Qt::WindowFlags f=Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint)
 
 ctkMessageBox (QWidget *newParent=0)
 
virtual void done (int resultCode)
 Reimplemented for internal reasons. More...
 
bool dontShowAgain () const
 
QString dontShowAgainSettingsKey () const
 
bool isDontShowAgainVisible () const
 
void setDontShowAgainSettingsKey (const QString &key)
 
void setDontShowAgainVisible (bool visible)
 
virtual void setVisible (bool visible)
 Reimplemented for internal reasons. More...
 
virtual ~ctkMessageBox ()
 

Static Public Member Functions

static bool confirmExit (const QString &dontShowAgainKey=QString(), QWidget *parentWidget=0)
 

Protected Attributes

QScopedPointer< ctkMessageBoxPrivate > d_ptr
 

Properties

bool dontShowAgain
 
QString dontShowAgainSettingsKey
 
bool dontShowAgainVisible
 

Detailed Description

ctkMessageBox is an advanced QMessageBox with extra features such as a checkbox to automatically accept the messagebox next time exec() is called.

Definition at line 35 of file ctkMessageBox.h.

Member Typedef Documentation

◆ Superclass

typedef QMessageBox ctkMessageBox::Superclass

Definition at line 68 of file ctkMessageBox.h.

Constructor & Destructor Documentation

◆ ctkMessageBox() [1/2]

ctkMessageBox::ctkMessageBox ( QWidget *  newParent = 0)

◆ ctkMessageBox() [2/2]

ctkMessageBox::ctkMessageBox ( Icon  icon,
const QString &  title,
const QString &  text,
StandardButtons  buttons = NoButton,
QWidget *  parent = 0,
Qt::WindowFlags  f = Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint 
)

◆ ~ctkMessageBox()

virtual ctkMessageBox::~ctkMessageBox ( )
virtual

Member Function Documentation

◆ confirmExit()

static bool ctkMessageBox::confirmExit ( const QString &  dontShowAgainKey = QString(),
QWidget *  parentWidget = 0 
)
static

Utility function that opens a dialog to confirm exit. If dontShowAgainKey is empty, the dontShowAgain checkbox is hidden and the message box is always open for the user to confirm exit.

◆ done()

virtual void ctkMessageBox::done ( int  resultCode)
virtual

Reimplemented for internal reasons.

◆ dontShowAgain()

bool ctkMessageBox::dontShowAgain ( ) const

◆ dontShowAgainSettingsKey()

QString ctkMessageBox::dontShowAgainSettingsKey ( ) const

◆ isDontShowAgainVisible()

bool ctkMessageBox::isDontShowAgainVisible ( ) const

◆ setDontShowAgain

void ctkMessageBox::setDontShowAgain ( bool  dontShow)
slot

Change the checkbox and the settings if any.

◆ setDontShowAgainSettingsKey()

void ctkMessageBox::setDontShowAgainSettingsKey ( const QString &  key)

◆ setDontShowAgainVisible()

void ctkMessageBox::setDontShowAgainVisible ( bool  visible)

◆ setVisible()

virtual void ctkMessageBox::setVisible ( bool  visible)
virtual

Reimplemented for internal reasons.

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkMessageBoxPrivate> ctkMessageBox::d_ptr
protected

Definition at line 99 of file ctkMessageBox.h.

Property Documentation

◆ dontShowAgain

bool ctkMessageBox::dontShowAgain
readwrite

This property holds wether the dialog should be shown next time exec() is called. dontShowAgain can be changed programatically by calling setDontShowAgain or when the user checks the "Dont show again" checkbox and the dialog is accepted. If the checkbox is checked by the user but the dialog is rejected (click on Cancel), dontShowAgain is not changed. If dontShowAgainSettingsKey is set, the dontShowAgain is set with the value of the key. By default, dontShowAgain is false.

Definition at line 1 of file ctkMessageBox.h.

◆ dontShowAgainSettingsKey

QString ctkMessageBox::dontShowAgainSettingsKey
readwrite

This property holds the settings key that is used to synchronize the state of the checkbox "Don't show this message again" with the given key value within QSettings. If the settings value is != QMessageBox::InvalidRole, the dialog is shown, otherwise it is skipped by simulating a click on the button corresponding to the settings value (QMessageButton::StandardButton or QMessageBox::ButtonRole) If a non empty key is set, the check box gets visible, otherwise it is hidden. By default, no key is set.

Definition at line 1 of file ctkMessageBox.h.

◆ dontShowAgainVisible

bool ctkMessageBox::dontShowAgainVisible
readwrite

This property controls the visibility of the "Don't show again" checkbox. Even if the checkbox is not visible, the dialog is not not shown if dontShowAgain is true. By default, the "Don't show again" checkbox is not visible.

Definition at line 1 of file ctkMessageBox.h.


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