45 #include <QtGui/qdialog.h> 53 #ifndef QT_NO_MESSAGEBOX 69 StandardButtons standardButtons;
70 #ifndef QT_NO_TEXTEDIT 105 SaveAll = 0x00001000,
108 YesToAll = 0x00008000,
110 NoToAll = 0x00020000,
120 RestoreDefaults = 0x08000000,
123 LastButton = RestoreDefaults,
130 FlagMask = 0x00000300,
152 #ifdef Q_NO_USING_KEYWORD 164 void setStandardButtons(StandardButtons
buttons);
165 StandardButtons standardButtons()
const;
180 void setText(
const QString &text);
186 void setIconPixmap(
const QPixmap &pixmap);
213 int button0,
int button1,
int button2,
219 int button0,
int button1 = 0,
int button2 = 0);
225 int defaultButtonNumber = 0,
226 int escapeButtonNumber = -1);
230 {
return information(parent, title, text, StandardButtons(button0), button1); }
234 int button0,
int button1 = 0,
int button2 = 0);
240 int defaultButtonNumber = 0,
241 int escapeButtonNumber = -1);
245 {
return question(parent, title, text, StandardButtons(button0), button1); }
249 int button0,
int button1,
int button2 = 0);
255 int defaultButtonNumber = 0,
256 int escapeButtonNumber = -1);
260 {
return warning(parent, title, text, StandardButtons(button0), button1); }
264 int button0,
int button1,
int button2 = 0);
270 int defaultButtonNumber = 0,
271 int escapeButtonNumber = -1);
275 {
return critical(parent, title, text, StandardButtons(button0), button1); }
277 QString buttonText(
int button)
const;
278 void setButtonText(
int button,
const QString &text);
280 QString informativeText()
const;
281 void setInformativeText(
const QString &text);
283 #ifndef QT_NO_TEXTEDIT 285 void setDetailedText(
const QString &text);
293 int button0,
int button1,
int button2,
296 QT3_SUPPORT_CONSTRUCTOR QMessageBox(
QWidget *parent,
const char *name);
298 static QT3_SUPPORT
QPixmap standardIcon(
Icon icon, Qt::GUIStyle);
299 static QT3_SUPPORT
int message(
const QString &title,
302 QWidget *parent = 0,
const char * = 0) {
304 buttonText.
isEmpty() ?
tr(
"OK") : buttonText) == 0;
306 static QT3_SUPPORT
bool query(
const QString &title,
310 QWidget *parent = 0,
const char * = 0) {
312 yesButtonText.
isEmpty() ?
tr(
"OK") : yesButtonText,
344 #define QT_REQUIRE_VERSION(argc, argv, str) { QString s = QString::fromLatin1(str);\ 345 QString sq = QString::fromLatin1(qVersion()); \ 346 if ((sq.section(QChar::fromLatin1('.'),0,0).toInt()<<16)+\ 347 (sq.section(QChar::fromLatin1('.'),1,1).toInt()<<8)+\ 348 sq.section(QChar::fromLatin1('.'),2,2).toInt()<(s.section(QChar::fromLatin1('.'),0,0).toInt()<<16)+\ 349 (s.section(QChar::fromLatin1('.'),1,1).toInt()<<8)+\ 350 s.section(QChar::fromLatin1('.'),2,2).toInt()) { \ 352 new QApplication(argc,argv); \ 354 QString s = QApplication::tr("Executable '%1' requires Qt "\ 355 "%2, found Qt %3.").arg(qAppName()).arg(QString::fromLatin1(\ 356 str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplication::tr(\ 357 "Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal("%s", s.toLatin1().data()); }} 359 #endif // QT_NO_MESSAGEBOX 365 #endif // QMESSAGEBOX_H
Icon
This enum has the following values:
The QKeyEvent class describes a key event.
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1=NoButton)
void keyPressEvent(QKeyEvent *)
Reimplemented Function
#define QT_END_NAMESPACE
This macro expands to.
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
The QDialog class is the base class of dialog windows.
int exec()
Shows the dialog as a modal dialog, blocking until the user closes it.
static Qt::MouseButtons buttons
The QMessageBox class provides a modal dialog for informing the user or for asking the user a questio...
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
void showEvent(QShowEvent *)
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
static const uint Default
void resizeEvent(QResizeEvent *)
Reimplemented Function
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
QString detailedText
the text to be displayed in the details area.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void closeEvent(QCloseEvent *)
Reimplemented Function
QSize sizeHint() const
Reimplemented Function
The QResizeEvent class contains event parameters for resize events.
StandardButton Button
Use QMessageBox::StandardButton instead.
The QShowEvent class provides an event that is sent when a widget is shown.
QString informativeText
the informative text that provides a fuller description for the message
static int question(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1)
ButtonRole
Combinations of these roles are as flags used to describe different aspects of their behavior...
bool event(QEvent *e)
Reimplemented Function
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens an information message box with the given title and text in front of the specified parent widge...
The QLabel widget provides a text or image display.
static int critical(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1)
The QPixmap class is an off-screen image representation that can be used as a paint device...
StandardButton
These enums describe flags for standard buttons.
void open()
Shows the dialog as a window modal dialog, returning immediately.
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
static int warning(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1)
The QEvent class is the base class of all event classes.
void setVisible(bool visible)
Reimplemented Function
The QCloseEvent class contains parameters that describe a close event.
The QList class is a template class that provides lists.