Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SUIT_MessageBox Class Reference

Message dialog box for SUIT-based application. More...

#include <SUIT_MessageBox.h>

Inheritance diagram for SUIT_MessageBox:
Inheritance graph

Classes

class  ButtonInfo
 

Public Member Functions

 SUIT_MessageBox (QWidget *=0)
 Constructor. More...
 
 SUIT_MessageBox (Icon, const QString &, const QString &, StandardButtons buttons=NoButton, QWidget *=0, Qt::WindowFlags=Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint)
 Constructor. More...
 
 ~SUIT_MessageBox ()
 Destructor. More...
 
QString buttonText (StandardButton) const
 Get the standard button text. More...
 
void setButtonText (StandardButton, const QString &)
 Set the standard button text. More...
 

Static Public Member Functions

static StandardButton critical (QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
 Show critical message box with specified standard buttons. More...
 
static StandardButton warning (QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
 
static StandardButton information (QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
 Show information message box with specified standard buttons. More...
 
static StandardButton question (QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
 Show question message box with specified standard buttons. More...
 
static int critical (QWidget *parent, const QString &title, const QString &text, const QString &button)
 Show critical message box with one custom button. More...
 
static int warning (QWidget *parent, const QString &title, const QString &text, const QString &button)
 Show warning message box with one custom button. More...
 
static int information (QWidget *parent, const QString &title, const QString &text, const QString &button)
 Show information message box with one custom button. More...
 
static int question (QWidget *parent, const QString &title, const QString &text, const QString &button)
 Show question message box with one custom button. More...
 
static int critical (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const int defaultButton=-1, const int escapeButton=-1)
 Show critical message box with two custom buttons. More...
 
static int warning (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const int defaultButton=-1, const int escapeButton=-1)
 Show warning message box with two custom buttons. More...
 
static int information (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const int defaultButton=-1, const int escapeButton=-1)
 Show information message box with two custom buttons. More...
 
static int question (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const int defaultButton=-1, const int escapeButton=-1)
 Show question message box with two custom buttons. More...
 
static int critical (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const int defaultButton=-1, const int escapeButton=-1)
 Show critical message box with three custom buttons. More...
 
static int warning (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const int defaultButton=-1, const int escapeButton=-1)
 Show warning message box with three custom buttons. More...
 
static int information (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const int defaultButton=-1, const int escapeButton=-1)
 Show information message box with three custom buttons. More...
 
static int question (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const int defaultButton=-1, const int escapeButton=-1)
 Show question message box with three custom buttons. More...
 
static int critical (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const QString &button4, const int defaultButton=-1, const int escapeButton=-1)
 Show critical message box with four custom buttons. More...
 
static int warning (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const QString &button4, const int defaultButton=-1, const int escapeButton=-1)
 Show warning message box with four custom buttons. More...
 
static int information (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const QString &button4, const int defaultButton=-1, const int escapeButton=-1)
 Show information message box with four custom buttons. More...
 
static int question (QWidget *parent, const QString &title, const QString &text, const QString &button1, const QString &button2, const QString &button3, const QString &button4, const int defaultButton=-1, const int escapeButton=-1)
 Show question message box with four custom buttons. More...
 
static int critical (QWidget *parent, const QString &title, const QString &text, const QStringList &buttons, const int defaultButton=-1, const int escapeButton=-1)
 Show critical message box with arbitrary number of user-specified buttons. More...
 
static int warning (QWidget *parent, const QString &title, const QString &text, const QStringList &buttons, const int defaultButton=-1, const int escapeButton=-1)
 Show warning message box with arbitrary number of user-specified buttons. More...
 
static int information (QWidget *parent, const QString &title, const QString &text, const QStringList &buttons, const int defaultButton=-1, const int escapeButton=-1)
 Show information message box with arbitrary number of user-specified buttons. More...
 
static int question (QWidget *parent, const QString &title, const QString &text, const QStringList &buttons, const int defaultButton=-1, const int escapeButton=-1)
 Show question message box with arbitrary number of user-specified buttons. More...
 
static int critical (QWidget *parent, const QString &title, const QString &text, const int defaultButton, const int escapeButton, char *,...)
 Show critical message box with arbitrary number of user-specified buttons. More...
 
static int warning (QWidget *parent, const QString &title, const QString &text, const int defaultButton, const int escapeButton, char *,...)
 Show warning message box with arbitrary number of user-specified buttons. More...
 
static int information (QWidget *parent, const QString &title, const QString &text, const int defaultButton, const int escapeButton, char *,...)
 Show information message box with arbitrary number of user-specified buttons. More...
 
static int question (QWidget *parent, const QString &title, const QString &text, const int defaultButton, const int escapeButton, char *,...)
 Show question message box with arbitrary number of user-specified buttons. More...
 

Private Types

typedef QList< ButtonInfoButtonInfos
 

Static Private Member Functions

static int messageBox (SUIT_MessageBox::Icon icon, QWidget *parent, const QString &title, const QString &text, const ButtonInfos &lst, const int defaultButton=-1, const int escapeButton=-1)
 Create and show the message box. More...
 
static ButtonInfos messageList (char *, va_list &)
 Parse arbitrary arguments list. More...
 

Detailed Description

The class provides a modal dialog with a short message, an icon, and buttons laid out depending on the current style.

Message boxes are used to provide informative messages and to ask simple questions.

The easiest way to pop up a message box is to call one of the static functions information(), question(), critical(), and warning().

The class provides the static functions to show message boxes with standard buttons (like Ok, Cancel, Apply, Close, Yes, No, Abort, Retry, etc). These methods accept ORed buttons flags as one of the parameters. The buttons layouting type and order is system-dependant and defined by the current style. In addition, these methods allow to define default button (where input focus is set by default and which is clicked when user presses Enter key).

Another set of static functions allows to show message boxes with up to four user-defined buttons. It is possible to define default and escape buttons using additional parameters.

And finally, the last group of static functions allow displaying the message boxes with an arbitrary number of buttons.

For example:

// show question message box with two standard buttons
int result = SUIT_MessageBox::question(desktop(), "Error",
"File already exists? Overwrite?",
SUIT_MessageBox::Yes | SUIT_MessageBox::No,
SUIT_MessageBox::No );
if ( result == SUIT_MessageBox::Yes )
overwriteFileFunction();
// show critical message box with user-defined buttons
// default is second button and escape is third button
int result = SUIT_MessageBox::critical(desktop(), "Hazard!",
"The situation is critical! What to do?",
"Hide", "Run Away", "Stand still", 1, 2);
switch ( result )
{
case 0:
hideMyself(); break;
case 1:
runAwayFromHere(); break;
case 2:
sitDownAndPray(); break;
default:
break;
}
// show message box with 6 buttons
// both default and escape buttons are set to first button ("Zero")
int result = SUIT_MessageBox::information(desktop(), "Question",
"Select your favourite number",
0, 0,
"Zero", "One", "Two", "Three", "Four", "Five");
useMyFavouriteNumberSomewhere( result );

Member Typedef Documentation

Constructor & Destructor Documentation

SUIT_MessageBox::SUIT_MessageBox ( QWidget parent = 0)
Parameters
parentparent widget
SUIT_MessageBox::SUIT_MessageBox ( Icon  icon,
const QString &  title,
const QString &  text,
StandardButtons  buttons = NoButton,
QWidget parent = 0,
Qt::WindowFlags  f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint 
)
Parameters
iconmessage box icon (QMessageBox::Icon)
titlemessage box title
textmessage box text
buttonsORed message box standard buttons (QMessageBox::StandardButton)
parentparent widget
fwindow flags
SUIT_MessageBox::~SUIT_MessageBox ( )

Member Function Documentation

QString SUIT_MessageBox::buttonText ( StandardButton  btn) const
Parameters
btnstandard button id
Returns
button text
SUIT_MessageBox::StandardButton SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
StandardButtons  buttons = Ok,
StandardButton  defaultButton = NoButton 
)
static
Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonsORed message box buttons (QMessageBox::StandardButton)
defaultButtondefault button (QMessageBox::StandardButton)
Returns
button id clicked by the user (QMessageBox::StandardButton)
int SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button 
)
static

Specified button becomes "default" button and "escape" button, i.e. pressing Return or Enter and Escape keys is equivalent to clicking this button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonbutton text
Returns
button id clicked by the user (QMessageBox::StandardButton)

References messageBox().

int SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1 and button2 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the second one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2 and button3 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const QString &  button4,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2, button3 and button4 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
button4fourth button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
const QStringList &  buttons,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

List of buttons to be shown is specified via buttons parameter.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
buttonslist of buttons to be shown
Returns
button used button id

References messageBox().

int SUIT_MessageBox::critical ( QWidget parent,
const QString &  title,
const QString &  text,
const int  defaultButton,
const int  escapeButton,
char *  btn,
  ... 
)
static

The function accepts arbitrary number of parameters. Each parameter starting from btn should be of type const char* to specify the button text. After the last button parameter and additional 0 (zero) value should be specified.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
btnfirst button text
Returns
button used button id

References messageBox(), and messageList().

SUIT_MessageBox::StandardButton SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
StandardButtons  buttons = Ok,
StandardButton  defaultButton = NoButton 
)
static
Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonsORed message box buttons (QMessageBox::StandardButton)
defaultButtondefault button (QMessageBox::StandardButton)
Returns
button id clicked by the user (QMessageBox::StandardButton)
int SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button 
)
static

Specified button becomes "default" button and "escape" button, i.e. pressing Return or Enter and Escape keys is equivalent to clicking this button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonbutton text
Returns
button id clicked by the user (QMessageBox::StandardButton)

References messageBox().

int SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1 and button2 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the second one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2 and button3 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const QString &  button4,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2, button3 and button4 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
button4fourth button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
const QStringList &  buttons,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

List of buttons to be shown is specified via buttons parameter.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
buttonslist of buttons to be shown
Returns
button used button id

References messageBox().

int SUIT_MessageBox::information ( QWidget parent,
const QString &  title,
const QString &  text,
const int  defaultButton,
const int  escapeButton,
char *  btn,
  ... 
)
static

The function accepts arbitrary number of parameters. Each parameter starting from btn should be of type const char* to specify the button text. After the last button parameter and additional 0 (zero) value should be specified.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
btnfirst button text
Returns
button used button id

References messageBox(), and messageList().

int SUIT_MessageBox::messageBox ( SUIT_MessageBox::Icon  icon,
QWidget parent,
const QString &  title,
const QString &  text,
const ButtonInfos lst,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
staticprivate
Parameters
iconicon type
parentparent widget
titlemessage box title
textmessage box text
lstlist of buttons infos
defaultButtondefault button
escapeButtonescape button
Returns
button used button id
SUIT_MessageBox::ButtonInfos SUIT_MessageBox::messageList ( char *  txt,
va_list &  args 
)
staticprivate

The last parameter in a sequence should be 0 (zero) value.

Parameters
txtfirst argument which starts arbitrary sequence
argsarguments list from the stack
Returns
list of buttons infos
SUIT_MessageBox::StandardButton SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
StandardButtons  buttons = Ok,
StandardButton  defaultButton = NoButton 
)
static
Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonsORed message box buttons (QMessageBox::StandardButton)
defaultButtondefault button (QMessageBox::StandardButton)
Returns
button id clicked by the user (QMessageBox::StandardButton)
int SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button 
)
static
Warning
This function does not make a lot of sense because it provides message box with only one button, i.e. it is impossible to give several answers for the question (at least 'yes'/'no'). This function is implemented only for completeness.

Specified button becomes "default" button and "escape" button, i.e. pressing Return or Enter and Escape keys is equivalent to clicking this button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonbutton text
Returns
button id clicked by the user (QMessageBox::StandardButton)

References messageBox().

int SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1 and button2 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the second one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2 and button3 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const QString &  button4,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2, button3 and button4 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
button4fourth button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
const QStringList &  buttons,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

List of buttons to be shown is specified via buttons parameter.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
buttonslist of buttons to be shown
Returns
button used button id

References messageBox().

int SUIT_MessageBox::question ( QWidget parent,
const QString &  title,
const QString &  text,
const int  defaultButton,
const int  escapeButton,
char *  btn,
  ... 
)
static

The function accepts arbitrary number of parameters. Each parameter starting from btn should be of type const char* to specify the button text. After the last button parameter and additional 0 (zero) value should be specified.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
btnfirst button text
Returns
button used button id

References messageBox(), and messageList().

void SUIT_MessageBox::setButtonText ( StandardButton  btn,
const QString &  text 
)
Parameters
btnstandard button id
textnew button text
static StandardButton SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
StandardButtons  buttons = Ok,
StandardButton  defaultButton = NoButton 
)
static
int SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button 
)
static

Specified button becomes "default" button and "escape" button, i.e. pressing Return or Enter and Escape keys is equivalent to clicking this button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
buttonbutton text
Returns
button id clicked by the user (QMessageBox::StandardButton)

References messageBox().

int SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1 and button2 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the second one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2 and button3 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
const QString &  button1,
const QString &  button2,
const QString &  button3,
const QString &  button4,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

Parameters button1, button2, button3 and button4 specify the buttons text. The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
button1first button text
button2second button text
button3third button text
button4fourth button text
defaultButtondefault button
escapeButtonescape button
Returns
button used button id

References messageBox().

int SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
const QStringList &  buttons,
const int  defaultButton = -1,
const int  escapeButton = -1 
)
static

List of buttons to be shown is specified via buttons parameter.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
buttonslist of buttons to be shown
Returns
button used button id

References messageBox().

int SUIT_MessageBox::warning ( QWidget parent,
const QString &  title,
const QString &  text,
const int  defaultButton,
const int  escapeButton,
char *  btn,
  ... 
)
static

The function accepts arbitrary number of parameters. Each parameter starting from btn should be of type const char* to specify the button text. After the last button parameter and additional 0 (zero) value should be specified.

The function returns clicked button id. The identifiers for the buttons are assigned automatically. The first button is identified as 0, the second one as 1, etc.

The defaultButton parameter allows to specify the button which is assigned for the Return or Enter key. Similarly, escapeButton parameter allows specifing the button which is assigned for Escape key. If these parameters are not specified (-1 by default), the first button is set as default button and the last one is defined as escape button.

Parameters
parentparent widget
titlemessage box title
textmessage box text
defaultButtondefault button
escapeButtonescape button
btnfirst button text
Returns
button used button id

References messageBox(), and messageList().


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