53 #ifndef QT_NO_MESSAGEBOX
56 class QMessageBoxPrivate;
69 Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons)
70 #ifndef QT_NO_TEXTEDIT
105 SaveAll = 0x00001000,
108 YesToAll = 0x00008000,
110 NoToAll = 0x00020000,
116 Discard = 0x00800000,
120 RestoreDefaults = 0x08000000,
123 LastButton = RestoreDefaults,
128 Default = 0x00000100,
130 FlagMask = 0x00000300,
131 ButtonMask = ~FlagMask
152 #ifdef Q_NO_USING_KEYWORD
164 void setStandardButtons(StandardButtons buttons);
165 StandardButtons standardButtons()
const;
171 void setDefaultButton(StandardButton button);
175 void setEscapeButton(StandardButton button);
180 void setText(
const QString &text);
191 static StandardButton information(
QWidget *parent,
const QString &title,
192 const QString &text, StandardButtons buttons = Ok,
193 StandardButton defaultButton = NoButton);
196 static StandardButton question(
QWidget *parent,
const QString &title,
197 const QString &text, StandardButtons buttons = Ok,
198 StandardButton defaultButton = NoButton);
199 static StandardButton warning(
QWidget *parent,
const QString &title,
200 const QString &text, StandardButtons buttons = Ok,
201 StandardButton defaultButton = NoButton);
202 static StandardButton critical(
QWidget *parent,
const QString &title,
203 const QString &text, StandardButtons buttons = Ok,
204 StandardButton defaultButton = NoButton);
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,
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,
317 static QPixmap standardIcon(Icon icon);
342 Q_DECLARE_OPERATORS_FOR_FLAGS(QMessageBox::StandardButtons)
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
static int question(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1)
static int critical(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1)
void setVisible(bool visible)
void showEvent(QShowEvent *)
GLXFBConfig Pixmap pixmap
void keyPressEvent(QKeyEvent *)
GLXDrawable GLXDrawable member
#define Q_PRIVATE_SLOT(d, signature)
static StandardButton information(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, StandardButton button0, StandardButton button1=NoButton)
#define QT_BEGIN_NAMESPACE
GLenum GLsizei GLenum format
GLuint const GLchar * name
void resizeEvent(QResizeEvent *)
static int warning(QWidget *parent, const QString &title, const QString &text, StandardButton button0, StandardButton button1)
void closeEvent(QCloseEvent *)