|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QDialog
com.trolltech.qt.gui.QMessageBox
public class QMessageBox
The QMessageBox
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.Basic Usage
The easiest way to pop up a message box in Qt is to call one of the static functions QMessageBox::information()
, QMessageBox::question()
, QMessageBox::critical()
, and QMessageBox::warning()
. For example:
int ret = QMessageBox::warning(this, tr("My Application"), tr("The document has been modified.\n" "Do you want to save your changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);Buttons are specified by combining StandardButtons using the bitwise OR operator. The order of the buttons on screen is platform-dependent. For example, on Windows, Save is displayed to the left of Cancel, whereas on Mac OS, the order is reversed.
The text part of all message box messages can be either rich text or plain text. With certain strings that contain XML meta characters, the auto-rich text detection may fail, interpreting plain text incorrectly as rich text. In these rare cases, use Qt::convertFromPlainText() to convert your plain text string to a visually equivalent rich text string or set the text format explicitly with setTextFormat()
.
Note that the Microsoft Windows User Interface Guidelines recommend using the application name as the window's title.
The Standard Dialogs example shows how to use QMessageBox
as well as other built-in Qt dialogs.Severity Levels
QMessageBox
supports four severity levels, indicated by an icon:
![]() | Question | For message boxes that ask a question as part of normal operation. Some style guides recommend using Information for this purpose. |
![]() | Information | For message boxes that are part of normal operation. |
![]() | Warning | For message boxes that tell the user about unusual errors. |
![]() | Critical | For message boxes that tell the user about critical errors. |
QMessageBox::information()
and QMessageBox::warning()
, are not flexible enough for your needs, you can instantiate a QMessageBox
on the stack. You can then use addButton()
to add buttons with standard or arbitrary text. When using an instance of QMessageBox
with standard buttons, you can test the return value of exec() to determine which button was clicked. For example,
QMessageBox msgBox; msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); switch (msgBox.exec()) { case QMessageBox::Yes: // yes was clicked break; case QMessageBox::No: // no was clicked break; default: // should never be reached break; }When using an instance of
QMessageBox
with custom buttons, you can test the value of clickedButton()
after calling exec(). For example, QMessageBox msgBox; QPushButton *connectButton = msgBox.addButton(tr("Connect"), QMessageBox::ActionRole); QPushButton *abortButton = msgBox.addButton(QMessageBox::Abort); msgBox.exec(); if (msgBox.clickedButton() == connectButton) { // connect } else if (msgBox.clickedButton() == abortButton) { // abort }In the example above, the Connect button is created using the
addButton()
overload that takes a text and a ButtonRole
. The ButtonRole
is used by QMessageBox
to determine the ordering of the buttons on screen (which varies according to the platform). The text()
, icon()
and iconPixmap()
functions provide access to the current text and pixmap of the message box. The setText()
, setIcon()
and setIconPixmap()
let you change it. The difference between setIcon()
and setIconPixmap()
is that the former accepts a QMessageBox::Icon
and can be used to set standard icons, whereas the latter accepts a QPixmap
and can be used to set custom icons.
setButtonText() and buttonText() provide access to the buttons.Default and Escape Keys
The default button (i.e., the button that is activated when the user presses Enter) can be specified using setDefaultButton()
. If none is specified, QMessageBox
will try to find one automatically based on the ButtonRole
s of the buttons in the dialog.
Similarly, the escape button (the button that is activated when the user presses Esc) is specified using setEscapeButton()
. If no escape button is specified, QMessageBox
attempts to automatically detect an escape button as follows:
Cancel
button, it is made the escape button.QMessageBox::RejectRole
or QMessageBox::NoRole
, it is made the escape button.QDialogButtonBox
, GUI Design Handbook: Message Box, Standard Dialogs Example, and Application Example.
Nested Class Summary | |
---|---|
static class |
QMessageBox.ButtonRole
This enum describes the roles that can be used to describe buttons in the button box. |
static class |
QMessageBox.Icon
This enum has the following values. |
static class |
QMessageBox.StandardButton
These enums describe flags for standard buttons. |
static class |
QMessageBox.StandardButtons
This is a flags class for com.trolltech.qt.gui.QMessageBox.StandardButton |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QDialog |
---|
QDialog.DialogCode |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.gui.QDialog |
---|
accepted, finished, rejected |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QMessageBox()
Constructs a message box with no text and no buttons. |
|
QMessageBox(QMessageBox.Icon icon,
java.lang.String title,
java.lang.String text)
Constructs a message box with the given icon, title, text, and standard buttons. |
|
QMessageBox(QMessageBox.Icon icon,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons)
Constructs a message box with the given icon, title, text, and standard buttons. |
|
QMessageBox(QMessageBox.Icon icon,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QWidget parent)
Constructs a message box with the given icon, title, text, and standard buttons. |
|
QMessageBox(QMessageBox.Icon icon,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QWidget parent,
Qt.WindowFlags f)
Constructs a message box with the given icon, title, text, and standard buttons. |
|
QMessageBox(QMessageBox.Icon icon,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QWidget parent,
Qt.WindowType[] f)
Constructs a message box with the given icon, title, text, and standard buttons. |
|
QMessageBox(QWidget parent)
Constructs a message box with no text and no buttons. |
Method Summary | |
---|---|
static void |
about(QWidget parent,
java.lang.String title,
java.lang.String text)
Displays a simple about box with title title and text text. |
static void |
aboutQt(QWidget parent)
Displays a simple message box about Qt, with the given title and centered over parent (if parent is not 0). |
static void |
aboutQt(QWidget parent,
java.lang.String title)
Displays a simple message box about Qt, with the given title and centered over parent (if parent is not 0). |
void |
addButton(QAbstractButton button,
QMessageBox.ButtonRole role)
Adds the given button to the message box with the specified role. |
QPushButton |
addButton(QMessageBox.StandardButton button)
Adds a standard button to the message box if it is valid to do so, and returns the push button. |
QPushButton |
addButton(java.lang.String text,
QMessageBox.ButtonRole role)
Creates a button with the given text, adds it to the message box for the specified role, and returns it. |
QAbstractButton |
button(QMessageBox.StandardButton which)
Returns a pointer corresponding to the standard button which, or 0 if the standard button doesn't exist in this message box. |
QAbstractButton |
clickedButton()
Returns the button that was clicked by the user, or 0 if the user hit the Esc key and no escape button was set. |
static QMessageBox.StandardButton |
critical(QWidget parent,
java.lang.String title,
java.lang.String text)
Opens a critical message box with the title title and the text text. |
static QMessageBox.StandardButton |
critical(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons)
Opens a critical message box with the title title and the text text. |
static QMessageBox.StandardButton |
critical(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QMessageBox.StandardButton defaultButton)
Opens a critical message box with the title title and the text text. |
QPushButton |
defaultButton()
Returns the button that should be the message box's default button . |
java.lang.String |
detailedText()
This property holds the text to be displayed in the details area. |
QAbstractButton |
escapeButton()
Returns the button that is activated when escape is pressed. |
static QMessageBox |
fromNativePointer(QNativePointer nativePointer)
|
QMessageBox.Icon |
icon()
This property holds the message box's icon. |
QPixmap |
iconPixmap()
This property holds the current icon. |
static QMessageBox.StandardButton |
information(QWidget parent,
java.lang.String title,
java.lang.String text)
Opens an information message box with the title title and the text text. |
static QMessageBox.StandardButton |
information(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons)
Opens an information message box with the title title and the text text. |
static QMessageBox.StandardButton |
information(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QMessageBox.StandardButton defaultButton)
Opens an information message box with the title title and the text text. |
java.lang.String |
informativeText()
This property holds the informative text that provides a fuller description for the message. |
static QMessageBox.StandardButton |
question(QWidget parent,
java.lang.String title,
java.lang.String text)
Opens a question message box with the title title and the text text. |
static QMessageBox.StandardButton |
question(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons)
Opens a question message box with the title title and the text text. |
static QMessageBox.StandardButton |
question(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QMessageBox.StandardButton defaultButton)
Opens a question message box with the title title and the text text. |
void |
removeButton(QAbstractButton button)
Removes button from the button box without deleting it. |
void |
setDefaultButton(QMessageBox.StandardButton button)
Sets the message box's default button to button. |
void |
setDefaultButton(QPushButton button)
Sets the message box's default button to button. |
void |
setDetailedText(java.lang.String text)
This property holds the text to be displayed in the details area. |
void |
setEscapeButton(QAbstractButton button)
Sets the button that gets activated when the Escape key is pressed to button. |
void |
setEscapeButton(QMessageBox.StandardButton button)
Sets the buttons that gets activated when the Escape key is pressed to button. |
void |
setIcon(QMessageBox.Icon arg__1)
This property holds the message box's icon. |
void |
setIconPixmap(QPixmap pixmap)
This property holds the current icon. |
void |
setInformativeText(java.lang.String text)
This property holds the informative text that provides a fuller description for the message. |
void |
setStandardButtons(QMessageBox.StandardButton[] buttons)
This property holds collection of standard buttons in the message box. |
void |
setStandardButtons(QMessageBox.StandardButtons buttons)
This property holds collection of standard buttons in the message box. |
void |
setText(java.lang.String text)
This property holds the message box text to be displayed. |
void |
setTextFormat(Qt.TextFormat format)
This property holds the format of the text displayed by the message box. |
QMessageBox.StandardButton |
standardButton(QAbstractButton button)
Returns the standard button enum value corresponding to the given button, or NoButton if the given button isn't a standard button. |
QMessageBox.StandardButtons |
standardButtons()
This property holds collection of standard buttons in the message box. |
java.lang.String |
text()
This property holds the message box text to be displayed. |
Qt.TextFormat |
textFormat()
This property holds the format of the text displayed by the message box. |
static QMessageBox.StandardButton |
warning(QWidget parent,
java.lang.String title,
java.lang.String text)
Opens a warning message box with the title title and the text text. |
static QMessageBox.StandardButton |
warning(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons)
Opens a warning message box with the title title and the text text. |
static QMessageBox.StandardButton |
warning(QWidget parent,
java.lang.String title,
java.lang.String text,
QMessageBox.StandardButtons buttons,
QMessageBox.StandardButton defaultButton)
Opens a warning message box with the title title and the text text. |
Methods inherited from class com.trolltech.qt.gui.QDialog |
---|
accept, done, exec, isSizeGripEnabled, reject, result, setModal, setResult, setSizeGripEnabled |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QMessageBox(QMessageBox.Icon icon, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QWidget parent, Qt.WindowType[] f)
addButton()
.) If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent and f arguments are passed to the QDialog
constructor.
setText()
, setIcon()
, and setStandardButtons()
.
public QMessageBox(QMessageBox.Icon icon, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QWidget parent)
addButton()
.) If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent and f arguments are passed to the QDialog
constructor.
setText()
, setIcon()
, and setStandardButtons()
.
public QMessageBox(QMessageBox.Icon icon, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons)
addButton()
.) If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent and f arguments are passed to the QDialog
constructor.
setText()
, setIcon()
, and setStandardButtons()
.
public QMessageBox(QMessageBox.Icon icon, java.lang.String title, java.lang.String text)
addButton()
.) If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent and f arguments are passed to the QDialog
constructor.
setText()
, setIcon()
, and setStandardButtons()
.
public QMessageBox(QMessageBox.Icon icon, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QWidget parent, Qt.WindowFlags f)
addButton()
.) If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent and f arguments are passed to the QDialog
constructor.
setText()
, setIcon()
, and setStandardButtons()
.
public QMessageBox()
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent argument is passed to the QDialog
constructor.
public QMessageBox(QWidget parent)
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
The parent argument is passed to the QDialog
constructor.
Method Detail |
---|
public final void addButton(QAbstractButton button, QMessageBox.ButtonRole role)
removeButton()
, button()
, and setStandardButtons()
.
public final QPushButton addButton(QMessageBox.StandardButton button)
setStandardButtons()
.
public final QPushButton addButton(java.lang.String text, QMessageBox.ButtonRole role)
public final QAbstractButton button(QMessageBox.StandardButton which)
standardButtons
, and standardButton()
.
public final QAbstractButton clickedButton()
escape button
was set. If exec() hasn't been called yet, returns 0.
Example:
QMessageBox messageBox(this); QAbstractButton *disconnectButton = messageBox.addButton(tr("Disconnect"), QMessageBox::ActionRole); ... messageBox.exec(); if (messageBox.clickedButton() == disconnectButton) { ... }
standardButton()
, and button()
.
public final QPushButton defaultButton()
default button
. Returns 0 if no default button was set. setDefaultButton()
, addButton()
, and QPushButton::setDefault()
.
public final java.lang.String detailedText()
public final QAbstractButton escapeButton()
By default, QMessageBox
attempts to automatically detect an escape button as follows:
Cancel
button, it is made the escape button.QMessageBox::RejectRole
, it is made the escape button.setEscapeButton()
, and addButton()
.
public final QMessageBox.Icon icon()
QMessageBox::NoIcon
QMessageBox::Question
QMessageBox::Information
QMessageBox::Warning
QMessageBox::Critical
GUI style
. You can also set a custom pixmap icon using the QMessageBox::iconPixmap
property. The default icon is QMessageBox::NoIcon
. iconPixmap
.
public final QPixmap iconPixmap()
icon
.
public final java.lang.String informativeText()
text()
to give more information to the user. On the Mac, this text appears in small system font below the text()
. On other platforms, it is simply appended to the existing text.
public final void removeButton(QAbstractButton button)
addButton()
, and setStandardButtons()
.
public final void setDefaultButton(QMessageBox.StandardButton button)
default button
to button. addButton()
, and QPushButton::setDefault()
.
public final void setDefaultButton(QPushButton button)
default button
to button. defaultButton()
, addButton()
, and QPushButton::setDefault()
.
public final void setDetailedText(java.lang.String text)
public final void setEscapeButton(QAbstractButton button)
escapeButton()
, addButton()
, and clickedButton()
.
public final void setEscapeButton(QMessageBox.StandardButton button)
addButton()
, and clickedButton()
.
public final void setIcon(QMessageBox.Icon arg__1)
QMessageBox::NoIcon
QMessageBox::Question
QMessageBox::Information
QMessageBox::Warning
QMessageBox::Critical
GUI style
. You can also set a custom pixmap icon using the QMessageBox::iconPixmap
property. The default icon is QMessageBox::NoIcon
. iconPixmap
.
public final void setIconPixmap(QPixmap pixmap)
icon
.
public final void setInformativeText(java.lang.String text)
text()
to give more information to the user. On the Mac, this text appears in small system font below the text()
. On other platforms, it is simply appended to the existing text.
public final void setStandardButtons(QMessageBox.StandardButton[] buttons)
addButton()
.
public final void setStandardButtons(QMessageBox.StandardButtons buttons)
addButton()
.
public final void setText(java.lang.String text)
QMessageBox::textFormat
). The default setting is Qt::AutoText
, i.e. the message box will try to auto-detect the format of the text. The default value of this property is an empty string.
textFormat
.
public final void setTextFormat(Qt.TextFormat format)
Qt::TextFormat
enum for an explanation of the possible options. The default format is Qt::AutoText
.
setText()
.
public final QMessageBox.StandardButton standardButton(QAbstractButton button)
NoButton
if the given button isn't a standard button. button()
, and standardButtons()
.
public final QMessageBox.StandardButtons standardButtons()
addButton()
.
public final java.lang.String text()
QMessageBox::textFormat
). The default setting is Qt::AutoText
, i.e. the message box will try to auto-detect the format of the text. The default value of this property is an empty string.
textFormat
.
public final Qt.TextFormat textFormat()
Qt::TextFormat
enum for an explanation of the possible options. The default format is Qt::AutoText
.
setText()
.
public static void about(QWidget parent, java.lang.String title, java.lang.String text)
about()
looks for a suitable icon in four locations:
parent->icon()
if that exists.active window.
QWidget::windowIcon()
, and QApplication::activeWindow()
.
public static void aboutQt(QWidget parent)
This is useful for inclusion in the Help menu of an application, as shown in the Menus example.
QApplication
provides this functionality as a slot.
QApplication::aboutQt()
.
public static void aboutQt(QWidget parent, java.lang.String title)
This is useful for inclusion in the Help menu of an application, as shown in the Menus example.
QApplication
provides this functionality as a slot.
QApplication::aboutQt()
.
public static QMessageBox.StandardButton critical(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, warning()
, and information()
.
public static QMessageBox.StandardButton critical(QWidget parent, java.lang.String title, java.lang.String text)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, warning()
, and information()
.
public static QMessageBox.StandardButton critical(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QMessageBox.StandardButton defaultButton)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, warning()
, and information()
.
public static QMessageBox.StandardButton information(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, warning()
, and critical()
.
public static QMessageBox.StandardButton information(QWidget parent, java.lang.String title, java.lang.String text)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, warning()
, and critical()
.
public static QMessageBox.StandardButton information(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QMessageBox.StandardButton defaultButton)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, warning()
, and critical()
.
public static QMessageBox.StandardButton question(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
information()
, warning()
, and critical()
.
public static QMessageBox.StandardButton question(QWidget parent, java.lang.String title, java.lang.String text)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
information()
, warning()
, and critical()
.
public static QMessageBox.StandardButton question(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QMessageBox.StandardButton defaultButton)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
information()
, warning()
, and critical()
.
public static QMessageBox.StandardButton warning(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, information()
, and critical()
.
public static QMessageBox.StandardButton warning(QWidget parent, java.lang.String title, java.lang.String text)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, information()
, and critical()
.
public static QMessageBox.StandardButton warning(QWidget parent, java.lang.String title, java.lang.String text, QMessageBox.StandardButtons buttons, QMessageBox.StandardButton defaultButton)
defaultButton
. If the defaultButton is set to QMessageBox::NoButton
, QMessageBox
picks a suitable default automatically. Returns the identity of the standard button that was activated. If Esc was pressed, returns the escape button
(if any).
If parent is 0, the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
question()
, information()
, and critical()
.
public static QMessageBox fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |