#include <ZMessageBox.h>
Inheritance diagram for ZMessageBox::
Public Methods | |
ZMessageBox (QWidget *parent, const QPixmap &iconPixmap, const QString &text, const QString &button0Text=QString::null, const QString &button1Text=QString::null, const QString &button2Text=QString::null, int modal=ZBaseDialog::APP_MODAL) | |
Constructor for a message box with a text, an icon and up to three buttons. More... | |
ZMessageBox (QWidget *parent, const QPixmap &iconPixmap, const QString &text, const int nseconds, int modal=ZBaseDialog::APP_MODAL) | |
Constructor for a message box with a text, an icon. More... | |
~ZMessageBox () | |
Destructor. More... | |
void | setText (const QString &text) |
Sets the message box text to be displayed. More... | |
void | setIconPixmap (const QPixmap &pixmap) |
Sets the message box icon to be displayed. More... | |
void | setButtonText (int button, const QString &text) |
Sets the text of the message box button. More... | |
void | adjustSize () |
Adjusts the size of the message box to fit the contents just before QDialog::exec() or QDialog::show() is called. More... | |
Static Public Methods | |
int | information (QWidget *parent, const QPixmap &iconPixmap, const QString &text, const QString &button0Text=QString::null, const QString &button1Text=QString::null, const QString &button2Text=QString::null, int modal=ZBaseDialog::APP_MODAL) |
Opens an message box with a text and up to three buttons. More... | |
int | timerInformation (QWidget *parent, const QPixmap &iconPixmap, const QString &text, int nseconds, const QString &button0Text=QString::null, const QString &button1Text=QString::null, const QString &button2Text=QString::null, int modal=ZBaseDialog::APP_MODAL) |
Opens an information message box with a text and up to threee buttons. More... | |
void | timerMessage (QWidget *parent, const QPixmap &iconPixmap, const QString &text, const int nseconds, int modal=ZBaseDialog::APP_MODAL) |
Opens an information message box with a text and no button. More... | |
Protected Methods | |
void | resizeEvent (QResizeEvent *) |
@reimplemented. More... | |
void | keyPressEvent (QKeyEvent *) |
@reimplemented. More... |
ZMessageBox provides two types of dialogs: a dialog with up to three buttons and a dialog which will automatically disappear after specified seconds.
As ZMessageBox inherits from ZBaseDialog, the ZMessageBox modal can be modeless, modal, and system modal.
ZMessageBox* msgbox = new ZMessageBox(this, pixmapPhone, "System Failure\nUnleashing fury upon the world now....", "OK", "Cancel", NULL ); int reply = msgbox->exec(); delete msgbox; switch(reply) { case 0: cout<<"OK was Pressed"<<endl; break; case 1: cout<<"Cancel was Pressed"<<endl; break; }
Below is the example of a message box which will automitically disappear after 2 seconds.
ZMessageBox* msgbox = new ZMessageBox(this, pixmapPhone, "System Failure\nFormatting Disk C:", 2); msgbox->exec(); delete msgbox;
|
Constructor for a message box with a text, an icon and up to three buttons.
|
|
Constructor for a message box with a text, an icon. The message box will automatically disappear after nseconds.
|
|
Destructor.
|
|
Adjusts the size of the message box to fit the contents just before QDialog::exec() or QDialog::show() is called.
|
|
Opens an message box with a text and up to three buttons.
|
|
@reimplemented.
|
|
@reimplemented.
|
|
Sets the text of the message box button.
|
|
Sets the message box icon to be displayed.
|
|
Sets the message box text to be displayed.
|
|
Opens an information message box with a text and up to threee buttons. The message box will return if timer is set.
|
|
Opens an information message box with a text and no button. The message box will return if timer is set.
|