Qyoto
4.0.7
Qyoto is a C# language binding for Qt
|
The QMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer. More...
Public Types | |
enum | ButtonRole { AcceptRole = 0, ActionRole = 3, ApplyRole = 8, DestructiveRole = 2, HelpRole = 4, InvalidRole = -1, NRoles = 9, NoRole = 6, RejectRole = 1, ResetRole = 7, YesRole = 5 } |
More... | |
enum | Icon { Critical = 3, Information = 1, NoIcon = 0, Question = 4, Warning = 2 } |
More... | |
enum | StandardButton { Abort = 262144, Apply = 33554432, ButtonMask = -769, Cancel = 4194304, Close = 2097152, Default = 256, Discard = 8388608, Escape = 512, FirstButton = 1024, FlagMask = 768, Help = 16777216, Ignore = 1048576, LastButton = 134217728, No = 65536, NoAll = 131072, NoButton = 0, NoToAll = 131072, Ok = 1024, Open = 8192, Reset = 67108864, RestoreDefaults = 134217728, Retry = 524288, Save = 2048, SaveAll = 4096, Yes = 16384, YesAll = 32768, YesToAll = 32768 } |
More... | |
![]() | |
enum | DialogCode { Accepted = 1, Rejected = 0 } |
More... | |
![]() | |
enum | RenderFlag { DrawChildren = 2, DrawWindowBackground = 1, IgnoreMask = 4 } |
More... | |
Public Member Functions | |
QMessageBox (QWidget parent=null) | |
More... | |
QMessageBox (QMessageBox.Icon icon, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.NoButton, QWidget parent=null, Qt.WindowType flags=Qt.WindowType.Dialog|Qt.WindowType.MSWindowsFixedSizeDialogHint) | |
More... | |
QMessageBox (string title, string text, QMessageBox.Icon icon, int button0, int button1, int button2, QWidget parent=null, Qt.WindowType f=Qt.WindowType.Dialog|Qt.WindowType.MSWindowsFixedSizeDialogHint) | |
More... | |
override void | CreateProxy () |
new void | AddButton (QAbstractButton button, QMessageBox.ButtonRole role) |
More... | |
new QPushButton | AddButton (QMessageBox.StandardButton button) |
More... | |
new QPushButton | AddButton (string text, QMessageBox.ButtonRole role) |
More... | |
new QAbstractButton | Button (QMessageBox.StandardButton which) |
More... | |
new QMessageBox.ButtonRole | buttonRole (QAbstractButton button) |
More... | |
new string | ButtonText (int button) |
More... | |
override bool | OnEvent (QEvent e) |
More... | |
new void | Open () |
new void | Open (QObject receiver, string member) |
More... | |
new void | RemoveButton (QAbstractButton button) |
More... | |
new void | SetButtonText (int button, string text) |
More... | |
new void | SetDefaultButton (QMessageBox.StandardButton button) |
More... | |
new void | SetEscapeButton (QMessageBox.StandardButton button) |
More... | |
new void | SetWindowModality (Qt.WindowModality windowModality) |
More... | |
new void | SetWindowTitle (string title) |
More... | |
new QMessageBox.StandardButton | standardButton (QAbstractButton button) |
More... | |
new void | Dispose () |
![]() | |
QDialog (QWidget parent=null, Qt.WindowType f=0) | |
More... | |
virtual void | Accept () |
More... | |
virtual void | Done (int r) |
More... | |
override bool | EventFilter (QObject o, QEvent e) |
More... | |
new int | Exec () |
More... | |
new void | Open () |
More... | |
virtual void | Reject () |
More... | |
new void | ShowExtension (bool showIt) |
More... | |
new void | Dispose () |
![]() | |
QWidget (QWidget parent=null, Qt.WindowType f=0) | |
More... | |
override void | CreateProxy () |
new void | ActivateWindow () |
More... | |
new void | AddAction (QAction action) |
More... | |
new void | AddActions (System.Collections.Generic.List< QAction > actions) |
More... | |
new void | AdjustSize () |
More... | |
new QWidget | ChildAt (QPoint p) |
More... | |
new QWidget | ChildAt (int x, int y) |
More... | |
new void | ClearFocus () |
More... | |
new void | ClearMask () |
More... | |
new bool | Close () |
More... | |
new void | CreateWinId () |
new void | EnsurePolished () |
More... | |
override bool | OnEvent (QEvent @event) |
More... | |
new QWidget | FocusWidget () |
More... | |
new void | GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom) |
More... | |
virtual System.IntPtr | GetDC () |
More... | |
new void | GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0) |
More... | |
new void | GrabKeyboard () |
More... | |
new void | GrabMouse () |
More... | |
new void | GrabMouse (QCursor cursor) |
More... | |
new int | GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut) |
More... | |
virtual int | HeightForWidth (int w) |
More... | |
new void | Hide () |
More... | |
virtual object | InputMethodQuery (Qt.InputMethodQuery query) |
More... | |
new void | InsertAction (QAction before, QAction action) |
More... | |
new void | InsertActions (QAction before, System.Collections.Generic.List< QAction > actions) |
More... | |
new bool | IsAncestorOf (QWidget child) |
More... | |
new bool | IsEnabledTo (QWidget ancestor) |
More... | |
new bool | IsVisibleTo (QWidget ancestor) |
More... | |
new void | Lower () |
More... | |
new QPoint | MapFrom (QWidget parent, QPoint pos) |
More... | |
new QPoint | MapFromGlobal (QPoint pos) |
More... | |
new QPoint | MapFromParent (QPoint pos) |
More... | |
new QPoint | MapTo (QWidget parent, QPoint pos) |
More... | |
new QPoint | MapToGlobal (QPoint pos) |
More... | |
new QPoint | MapToParent (QPoint pos) |
More... | |
new void | Move (int x, int y) |
new void | OverrideWindowFlags (Qt.WindowType type) |
More... | |
new void | OverrideWindowState (Qt.WindowState state) |
new void | Raise () |
More... | |
virtual void | ReleaseDC (System.IntPtr hdc) |
More... | |
new void | ReleaseKeyboard () |
More... | |
new void | ReleaseMouse () |
More... | |
new void | ReleaseShortcut (int id) |
More... | |
new void | RemoveAction (QAction action) |
More... | |
new void | Render (IQPaintDevice target) |
More... | |
new void | Render (QPainter painter) |
More... | |
new void | Render (IQPaintDevice target, QPoint targetOffset) |
More... | |
new void | Render (QPainter painter, QPoint targetOffset) |
More... | |
new void | Render (IQPaintDevice target, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren) |
More... | |
new void | Render (QPainter painter, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren) |
More... | |
new void | Repaint () |
More... | |
new void | Repaint (QRect rect) |
More... | |
new void | Repaint (QRegion rgn) |
More... | |
new void | Repaint (int x, int y, int w, int h) |
More... | |
new void | Resize (int w, int h) |
new bool | RestoreGeometry (QByteArray geometry) |
More... | |
new QByteArray | SaveGeometry () |
More... | |
new void | Scroll (int dx, int dy) |
More... | |
new void | Scroll (int dx, int dy, QRect r) |
More... | |
new void | SetAttribute (Qt.WidgetAttribute attribute, bool on=true) |
More... | |
new void | SetBaseSize (int basew, int baseh) |
new void | SetContentsMargins (int left, int top, int right, int bottom) |
More... | |
new void | SetDisabled (bool disable) |
More... | |
new void | SetFixedHeight (int h) |
More... | |
new void | SetFixedSize (QSize s) |
More... | |
new void | SetFixedSize (int w, int h) |
More... | |
new void | SetFixedWidth (int w) |
More... | |
new void | SetFocus () |
More... | |
new void | SetFocus (Qt.FocusReason reason) |
More... | |
new void | SetGeometry (int x, int y, int w, int h) |
new void | SetHidden (bool hidden) |
More... | |
new void | SetMask (QBitmap bitmap) |
More... | |
new void | SetMaximumSize (int maxw, int maxh) |
new void | SetMinimumSize (int minw, int minh) |
new void | SetParent (QWidget parent) |
More... | |
new void | SetParent (QWidget parent, Qt.WindowType f) |
More... | |
new void | SetShortcutAutoRepeat (int id, bool enable=true) |
More... | |
new void | SetShortcutEnabled (int id, bool enable=true) |
More... | |
new void | SetShown (bool shown) |
More... | |
new void | SetSizeIncrement (int w, int h) |
new void | SetSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical) |
new void | Show () |
More... | |
new void | ShowFullScreen () |
More... | |
new void | ShowMaximized () |
More... | |
new void | ShowMinimized () |
More... | |
new void | ShowNormal () |
More... | |
new void | StackUnder (QWidget w) |
More... | |
new bool | TestAttribute (Qt.WidgetAttribute attribute) |
More... | |
new void | UngrabGesture (Qt.GestureType type) |
More... | |
new void | UnsetCursor () |
new void | UnsetLayoutDirection () |
new void | UnsetLocale () |
new void | Update () |
More... | |
new void | Update (QRect rect) |
More... | |
new void | Update (QRegion rgn) |
More... | |
new void | Update (int x, int y, int w, int h) |
More... | |
new void | UpdateGeometry () |
More... | |
new void | Dispose () |
![]() | |
QObject (QObject parent=null) | |
More... | |
new bool | BlockSignals (bool b) |
More... | |
new bool | Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
More... | |
new void | DeleteLater () |
More... | |
new bool | Disconnect (QObject receiver, string member=null) |
More... | |
new bool | Disconnect (string signal=null, QObject receiver=null, string member=null) |
More... | |
new void | DumpObjectInfo () |
More... | |
new void | DumpObjectTree () |
More... | |
virtual bool | EventFilter (QObject watched, QEvent @event) |
More... | |
new bool | Inherits (string classname) |
More... | |
new void | InstallEventFilter (QObject filterObj) |
More... | |
new void | KillTimer (int id) |
More... | |
new object | Property (string name) |
More... | |
new void | RemoveEventFilter (QObject obj) |
More... | |
new bool | SetProperty (string name, object value) |
More... | |
new void | SetUserData (uint id, QObjectUserData data) |
new int | StartTimer (int interval) |
More... | |
new QObjectUserData | UserData (uint id) |
new void | Dispose () |
![]() | |
delegate QTextStream | FuncQTextStreamQTextStream (QTextStream qTextStream) |
delegate void | ActionQtMsgTypeString (QtMsgType qtMsgType, string @string) |
delegate QObject | FuncQObject () |
delegate string | FuncStringQByteArray (QByteArray qByteArray) |
delegate QByteArray | FuncQByteArrayString (string @string) |
Static Public Member Functions | |
static void | About (QWidget parent, string title, string text) |
More... | |
static void | AboutQt (QWidget parent, string title="") |
More... | |
static QMessageBox.StandardButton | Critical (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
More... | |
static int | Critical (QWidget parent, string title, string text, int button0, int button1, int button2=0) |
More... | |
static int | Critical (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
More... | |
static QMessageBox.StandardButton | Information (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
More... | |
static int | Information (QWidget parent, string title, string text, int button0, int button1=0, int button2=0) |
More... | |
static int | Information (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
More... | |
static QMessageBox.StandardButton | Question (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
More... | |
static int | Question (QWidget parent, string title, string text, int button0, int button1=0, int button2=0) |
More... | |
static int | Question (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
More... | |
static QPixmap | StandardIcon (QMessageBox.Icon icon) |
More... | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
static QMessageBox.StandardButton | Warning (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
More... | |
static int | Warning (QWidget parent, string title, string text, int button0, int button1, int button2=0) |
More... | |
static int | Warning (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
More... | |
![]() | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
![]() | |
static QWidget | Find (NativeULong id) |
More... | |
static void | SetTabOrder (QWidget first, QWidget second) |
More... | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
![]() | |
static bool | Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
More... | |
static bool | Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
More... | |
static bool | Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member) |
More... | |
static bool | Disconnect (QObject sender, string signal, QObject receiver, string member) |
More... | |
static string | Tr (string s, string c=null) |
More... | |
static string | Tr (string s, string c, int n) |
More... | |
static string | TrUtf8 (string s, string c=null) |
More... | |
static string | TrUtf8 (string s, string c, int n) |
More... | |
![]() | |
static QDataStream | Write (QDataStream s, object p) |
static QDataStream | Write (QDataStream stream, QSizeF size) |
More... | |
static QDataStream | Write (QDataStream stream, QPoint point) |
More... | |
static QTextStream | Write (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Write (QDataStream stream, QLineF line) |
More... | |
static QDataStream | Write (QDataStream stream, QPointF point) |
More... | |
static QDataStream | Write (QDataStream @out, QChar chr) |
More... | |
static QDataStream | Write (QDataStream @out, QByteArray ba) |
More... | |
static QDataStream | Write (QDataStream stream, QEasingCurve easing) |
More... | |
static QDataStream | Write (QDataStream stream, QRectF rectangle) |
More... | |
static QDataStream | Write (QDataStream @out, QDateTime dateTime) |
More... | |
static QDataStream | Write (QDataStream @out, QUrl url) |
More... | |
static QDataStream | Write (QDataStream @out, QTime time) |
More... | |
static QDataStream | Write (QDataStream arg1, QLocale arg2) |
static QDataStream | Write (QDataStream @out, QBitArray ba) |
More... | |
static QDataStream | Write (QDataStream s, QUuid id) |
More... | |
static QDataStream | Write (QDataStream stream, QLine line) |
More... | |
static QDataStream | Write (QDataStream @out, QDate date) |
More... | |
static QDataStream | Write (QDataStream @out, QRegExp regExp) |
More... | |
static QDataStream | Write (QDataStream stream, QRect rectangle) |
More... | |
static QDataStream | Write (QDataStream stream, QSize size) |
More... | |
static QDataStream | Write (QDataStream s, QVariant.Type p) |
static QDataStream | Write (QDataStream arg1, string arg2) |
static QDataStream | Write (QDataStream @out, System.Collections.Generic.List< string > list) |
More... | |
static QDataStream | Read (QDataStream @in, QChar chr) |
More... | |
static QDataStream | Read (QDataStream arg1, QLocale arg2) |
static QDataStream | Read (QDataStream stream, QRect rectangle) |
More... | |
static QDataStream | Read (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Read (QDataStream @in, QDate date) |
More... | |
static QDataStream | Read (QDataStream @in, QUrl url) |
More... | |
static QDataStream | Read (QDataStream s, QUuid id) |
More... | |
static QTextStream | Read (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Read (QDataStream stream, QLineF line) |
More... | |
static QDataStream | Read (QDataStream stream, QRectF rectangle) |
More... | |
static QDataStream | Read (QDataStream stream, QPointF point) |
More... | |
static QDataStream | Read (QDataStream stream, QLine line) |
More... | |
static QDataStream | Read (QDataStream @in, QBitArray ba) |
More... | |
static QDataStream | Read (QDataStream stream, QSize size) |
More... | |
static QDataStream | Read (QDataStream @in, QDateTime dateTime) |
More... | |
static QDataStream | Read (QDataStream @in, QTime time) |
More... | |
static QDataStream | Read (QDataStream stream, QPoint point) |
More... | |
static QDataStream | Read (QDataStream @in, QRegExp regExp) |
More... | |
static QDataStream | Read (QDataStream s, object p) |
static QDataStream | Read (QDataStream @in, QByteArray ba) |
More... | |
static QDataStream | Read (QDataStream stream, QSizeF size) |
More... | |
static QDataStream | Read (QDataStream arg1, string arg2) |
static QDataStream | Read (QDataStream s, QVariant.Type p) |
static QDataStream | Read (QDataStream @in, System.Collections.Generic.List< string > list) |
More... | |
static double | QAcos (double v) |
More... | |
static void | QAddPostRoutine (System.Action ptr) |
More... | |
static double | QAsin (double v) |
More... | |
static double | QAtan (double v) |
More... | |
static double | QAtan2 (double x, double y) |
More... | |
static void | QBadAlloc () |
static int | QCeil (double v) |
More... | |
static ushort | QChecksum (string s, uint len) |
More... | |
static QByteArray | QCompress (QByteArray data, int compressionLevel=-1) |
More... | |
static QByteArray | QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1) |
More... | |
static double | QCos (double v) |
More... | |
static double | QExp (double v) |
More... | |
static double | QFabs (double v) |
static double | QFastCos (double x) |
static double | QFastSin (double x) |
static string | QFlagLocation (string method) |
static int | QFloor (double v) |
More... | |
static bool | QFuzzyCompare (double p1, double p2) |
More... | |
static bool | QFuzzyCompare (float p1, float p2) |
More... | |
static bool | QFuzzyIsNull (double d) |
static bool | QFuzzyIsNull (float f) |
static uint | QHash (QBitArray key) |
More... | |
static uint | QHash (QChar key) |
More... | |
static uint | QHash (QStringRef key) |
static uint | QHash (QUrl url) |
More... | |
static uint | QHash (QPersistentModelIndex index) |
static uint | QHash (QByteArray key) |
More... | |
static uint | QHash (QModelIndex index) |
static uint | QHash (uint key) |
More... | |
static uint | QHash (char key) |
More... | |
static uint | QHash (byte key) |
More... | |
static uint | QHash (short key) |
More... | |
static uint | QHash (NativeLong key) |
More... | |
static uint | QHash (ushort key) |
More... | |
static uint | QHash (long key) |
More... | |
static uint | QHash (ulong key) |
More... | |
static uint | QHash (int key) |
More... | |
static uint | QHash (string key) |
More... | |
static uint | QHash (NativeULong key) |
More... | |
static Qt.ActionQtMsgTypeString | QInstallMsgHandler (Qt.ActionQtMsgTypeString handler) |
More... | |
static int | QIntCast (float f) |
static int | QIntCast (double f) |
static bool | QIsFinite (double d) |
static bool | QIsFinite (float f) |
static bool | QIsInf (float f) |
static bool | QIsInf (double d) |
static bool | QIsNaN (float f) |
static bool | QIsNaN (double d) |
static bool | QIsNull (float f) |
static bool | QIsNull (double d) |
static double | QLn (double v) |
More... | |
static double | QPow (double x, double y) |
More... | |
static void | QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function) |
More... | |
static void | QRemovePostRoutine (System.Action arg1) |
static int | QRound (double d) |
More... | |
static long | QRound64 (double d) |
More... | |
static double | QSin (double v) |
More... | |
static double | QSqrt (double v) |
More... | |
static bool | QStringComparisonHelper (QStringRef s1, string s2) |
static double | QTan (double v) |
More... | |
static QByteArray | QUncompress (QByteArray data) |
More... | |
static QByteArray | QUncompress (Pointer< byte > data, int nbytes) |
More... | |
static void | Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size) |
static QByteArray | Qgetenv (string varName) |
More... | |
static bool | Qputenv (string varName, QByteArray value) |
More... | |
static void | Qsrand (uint seed) |
More... | |
static int | Qstrcmp (QByteArray str1, QByteArray str2) |
static int | Qstrcmp (QByteArray str1, string str2) |
static int | Qstrcmp (string str1, QByteArray str2) |
static int | Qstrcmp (string str1, string str2) |
More... | |
static Pointer< sbyte > | Qstrcpy (Pointer< sbyte > dst, string src) |
More... | |
static Pointer< sbyte > | Qstrdup (string src) |
More... | |
static int | Qstricmp (string str1, string str2) |
More... | |
static uint | Qstrlen (string str) |
More... | |
static int | Qstrncmp (string str1, string str2, uint len) |
More... | |
static Pointer< sbyte > | Qstrncpy (Pointer< sbyte > dst, string src, uint len) |
More... | |
static int | Qstrnicmp (string str1, string str2, uint len) |
More... | |
static uint | Qstrnlen (string str, uint maxlen) |
More... | |
Protected Member Functions | |
QMessageBox (System.Type dummy) | |
new void | OnButtonClicked (QAbstractButton button) |
More... | |
override void | OnChangeEvent (QEvent @event) |
More... | |
override void | OnCloseEvent (QCloseEvent @event) |
More... | |
override void | OnKeyPressEvent (QKeyEvent @event) |
More... | |
override void | OnResizeEvent (QResizeEvent @event) |
More... | |
override void | OnShowEvent (QShowEvent @event) |
More... | |
![]() | |
QDialog (System.Type dummy) | |
new void | OnAccepted () |
More... | |
new void | AdjustPosition (QWidget arg1) |
override void | OnCloseEvent (QCloseEvent e) |
More... | |
override void | OnContextMenuEvent (QContextMenuEvent e) |
More... | |
new void | OnFinished (int result) |
More... | |
override void | OnKeyPressEvent (QKeyEvent e) |
More... | |
new void | OnRejected () |
More... | |
![]() | |
QWidget (System.Type dummy) | |
virtual void | OnActionEvent (QActionEvent @event) |
More... | |
virtual void | OnContextMenuEvent (QContextMenuEvent @event) |
More... | |
new void | Create () |
More... | |
new void | Create (NativeULong window, bool initializeWindow=true, bool destroyOldWindow=true) |
More... | |
new void | OnCustomContextMenuRequested (QPoint pos) |
More... | |
new void | Destroy (bool destroyWindow=true, bool destroySubWindows=true) |
More... | |
virtual void | OnDragEnterEvent (QDragEnterEvent @event) |
More... | |
virtual void | OnDragLeaveEvent (QDragLeaveEvent @event) |
More... | |
virtual void | OnDragMoveEvent (QDragMoveEvent @event) |
More... | |
virtual void | OnDropEvent (QDropEvent @event) |
More... | |
virtual void | EnabledChange (bool arg1) |
virtual void | OnEnterEvent (QEvent @event) |
More... | |
virtual void | OnFocusInEvent (QFocusEvent @event) |
More... | |
new bool | FocusNextChild () |
More... | |
virtual bool | FocusNextPrevChild (bool next) |
More... | |
virtual void | OnFocusOutEvent (QFocusEvent @event) |
More... | |
new bool | FocusPreviousChild () |
More... | |
virtual void | FontChange (QFont arg1) |
virtual void | OnHideEvent (QHideEvent @event) |
More... | |
virtual void | OnInputMethodEvent (QInputMethodEvent @event) |
More... | |
virtual void | OnKeyReleaseEvent (QKeyEvent @event) |
More... | |
virtual void | LanguageChange () |
More... | |
virtual void | OnLeaveEvent (QEvent @event) |
More... | |
virtual int | Metric (QPaintDevice.PaintDeviceMetric m) |
More... | |
virtual void | OnMouseDoubleClickEvent (QMouseEvent @event) |
More... | |
virtual void | OnMouseMoveEvent (QMouseEvent @event) |
More... | |
virtual void | OnMousePressEvent (QMouseEvent @event) |
More... | |
virtual void | OnMouseReleaseEvent (QMouseEvent @event) |
More... | |
virtual void | OnMoveEvent (QMoveEvent @event) |
More... | |
virtual void | OnPaintEvent (QPaintEvent @event) |
More... | |
virtual void | PaletteChange (QPalette arg1) |
new void | ResetInputContext () |
More... | |
virtual void | StyleChange (QStyle arg1) |
virtual void | OnTabletEvent (QTabletEvent @event) |
More... | |
new void | UpdateMicroFocus () |
More... | |
virtual void | OnWheelEvent (QWheelEvent @event) |
More... | |
virtual void | WindowActivationChange (bool arg1) |
![]() | |
QObject (System.Type dummy) | |
virtual void | OnChildEvent (QChildEvent @event) |
More... | |
virtual void | ConnectNotify (string signal) |
More... | |
virtual void | OnCustomEvent (QEvent @event) |
More... | |
new void | OnDestroyed (QObject obj=null) |
More... | |
virtual void | DisconnectNotify (string signal) |
More... | |
new int | Receivers (string signal) |
More... | |
virtual void | OnTimerEvent (QTimerEvent @event) |
More... | |
Properties | |
Slot< QAbstractButton > | ButtonClicked |
More... | |
QPushButton | DefaultButton [get, set] |
More... | |
QAbstractButton | EscapeButton [get, set] |
More... | |
override QSize | SizeHint [get] |
System.Collections.Generic.List < QAbstractButton > | Buttons [get] |
More... | |
QAbstractButton | ClickedButton [get] |
More... | |
new string | Text [get, set] |
More... | |
new Icon | icon [get, set] |
More... | |
new QPixmap | IconPixmap [get, set] |
More... | |
new Qt.TextFormat | TextFormat [get, set] |
More... | |
new QMessageBox.StandardButton | StandardButtons [get, set] |
More... | |
new string | DetailedText [get, set] |
More... | |
new string | InformativeText [get, set] |
More... | |
static new QMetaObject | StaticMetaObject [get] |
new IQMessageBoxSignals | Emit [get] |
![]() | |
Slot< System.Int32 > | Finished |
More... | |
Slot | Accepted |
More... | |
Slot | Rejected |
More... | |
QWidget | Extension [get, set] |
More... | |
Qt.Orientation | Orientation [get, set] |
More... | |
int | Result [get, set] |
More... | |
override bool | Visible [get, set] |
More... | |
override QSize | MinimumSizeHint [get] |
More... | |
override QSize | SizeHint [get] |
More... | |
new bool | SizeGripEnabled [get, set] |
More... | |
static new QMetaObject | StaticMetaObject [get] |
new IQDialogSignals | Emit [get] |
![]() | |
virtual EventHandler < QEventArgs< QActionEvent > > | ActionEvent |
More... | |
virtual EventHandler < QEventArgs< QEvent > > | ChangeEvent |
More... | |
virtual EventHandler < QEventArgs< QCloseEvent > > | CloseEvent |
More... | |
virtual EventHandler < QEventArgs < QContextMenuEvent > > | ContextMenuEvent |
More... | |
virtual EventHandler < QEventArgs< QDragEnterEvent > > | DragEnterEvent |
More... | |
virtual EventHandler < QEventArgs< QDragLeaveEvent > > | DragLeaveEvent |
More... | |
virtual EventHandler < QEventArgs< QDragMoveEvent > > | DragMoveEvent |
More... | |
virtual EventHandler < QEventArgs< QDropEvent > > | DropEvent |
More... | |
virtual EventHandler < QEventArgs< QEvent > > | EnterEvent |
More... | |
virtual EventHandler < QEventArgs< QFocusEvent > > | FocusInEvent |
More... | |
virtual EventHandler < QEventArgs< QFocusEvent > > | FocusOutEvent |
More... | |
virtual EventHandler < QEventArgs< QHideEvent > > | HideEvent |
More... | |
virtual EventHandler < QEventArgs < QInputMethodEvent > > | InputMethodEvent |
More... | |
virtual EventHandler < QEventArgs< QKeyEvent > > | KeyPressEvent |
More... | |
virtual EventHandler < QEventArgs< QKeyEvent > > | KeyReleaseEvent |
More... | |
virtual EventHandler < QEventArgs< QEvent > > | LeaveEvent |
More... | |
virtual EventHandler < QEventArgs< QMouseEvent > > | MouseDoubleClickEvent |
More... | |
virtual EventHandler < QEventArgs< QMouseEvent > > | MouseMoveEvent |
More... | |
virtual EventHandler < QEventArgs< QMouseEvent > > | MousePressEvent |
More... | |
virtual EventHandler < QEventArgs< QMouseEvent > > | MouseReleaseEvent |
More... | |
virtual EventHandler < QEventArgs< QMoveEvent > > | MoveEvent |
More... | |
virtual EventHandler < QEventArgs< QPaintEvent > > | PaintEvent |
More... | |
virtual EventHandler < QEventArgs< QResizeEvent > > | ResizeEvent |
More... | |
virtual EventHandler < QEventArgs< QShowEvent > > | ShowEvent |
More... | |
virtual EventHandler < QEventArgs< QTabletEvent > > | TabletEvent |
More... | |
virtual EventHandler < QEventArgs< QWheelEvent > > | WheelEvent |
More... | |
Slot< QPoint > | CustomContextMenuRequested |
More... | |
QPalette.ColorRole | BackgroundRole [get, set] |
More... | |
QMargins | ContentsMargins [get, set] |
More... | |
QWidget | FocusProxy [get, set] |
More... | |
QPalette.ColorRole | ForegroundRole [get, set] |
More... | |
QGraphicsEffect | GraphicsEffect [get, set] |
More... | |
QInputContext | InputContext [get, set] |
More... | |
QLayout | Layout [get, set] |
More... | |
QRegion | Mask [get, set] |
More... | |
QStyle | Style [get, set] |
More... | |
Qt.WindowType | WindowFlags [get, set] |
string | WindowRole [get, set] |
More... | |
Qt.WindowState | WindowState [get, set] |
More... | |
virtual int | DevType [get] |
virtual QPaintEngine | PaintEngine [get] |
More... | |
int | ColorCount [get] |
More... | |
int | Depth [get] |
More... | |
int | HeightMM [get] |
More... | |
int | LogicalDpiX [get] |
More... | |
int | LogicalDpiY [get] |
More... | |
int | NumColors [get] |
More... | |
bool | PaintingActive [get] |
More... | |
int | PhysicalDpiX [get] |
More... | |
int | PhysicalDpiY [get] |
More... | |
int | WidthMM [get] |
More... | |
System.Collections.Generic.List < QAction > | Actions [get] |
More... | |
QRect | ContentsRect [get] |
More... | |
NativeULong | EffectiveWinId [get] |
More... | |
QFontInfo | FontInfo [get] |
More... | |
QFontMetrics | FontMetrics [get] |
More... | |
QGraphicsProxyWidget | GraphicsProxyWidget [get] |
More... | |
NativeULong | InternalWinId [get] |
bool | IsEnabledToTLW [get] |
More... | |
bool | IsHidden [get] |
More... | |
bool | IsLeftToRight [get] |
bool | IsRightToLeft [get] |
bool | IsTopLevel [get] |
More... | |
bool | IsWindow [get] |
More... | |
static QWidget | KeyboardGrabber [get] |
More... | |
static QWidget | MouseGrabber [get] |
More... | |
QWidget | NativeParentWidget [get] |
More... | |
QWidget | NextInFocusChain [get] |
More... | |
QWidget | ParentWidget [get] |
More... | |
QWidget | PreviousInFocusChain [get] |
More... | |
QWidget | TopLevelWidget [get] |
More... | |
bool | UnderMouse [get] |
More... | |
QRegion | VisibleRegion [get] |
More... | |
NativeULong | WinId [get] |
More... | |
QWidget | Window [get] |
More... | |
Qt.WindowType | WindowType [get] |
More... | |
new bool | Modal [get] |
More... | |
new Qt.WindowModality | WindowModality [get, set] |
More... | |
new bool | Enabled [get, set] |
More... | |
new QRect | Geometry [get, set] |
More... | |
new QRect | FrameGeometry [get] |
More... | |
new QRect | NormalGeometry [get] |
More... | |
new int | X [get] |
More... | |
new int | Y [get] |
More... | |
new QPoint | Pos [get, set] |
More... | |
new QSize | FrameSize [get] |
More... | |
new QSize | Size [get, set] |
More... | |
new int | Width [get] |
More... | |
new int | Height [get] |
More... | |
new QRect | Rect [get] |
More... | |
new QRect | ChildrenRect [get] |
More... | |
new QRegion | ChildrenRegion [get] |
More... | |
new QSizePolicy | SizePolicy [get, set] |
More... | |
new QSize | MinimumSize [get, set] |
More... | |
new QSize | MaximumSize [get, set] |
More... | |
new int | MinimumWidth [get, set] |
More... | |
new int | MinimumHeight [get, set] |
More... | |
new int | MaximumWidth [get, set] |
More... | |
new int | MaximumHeight [get, set] |
More... | |
new QSize | SizeIncrement [get, set] |
More... | |
new QSize | BaseSize [get, set] |
More... | |
new QPalette | Palette [get, set] |
More... | |
new QFont | Font [get, set] |
More... | |
new QCursor | Cursor [get, set] |
More... | |
new bool | MouseTracking [get, set] |
More... | |
new bool | IsActiveWindow [get] |
More... | |
new Qt.FocusPolicy | FocusPolicy [get, set] |
More... | |
new bool | Focus [get] |
More... | |
new Qt.ContextMenuPolicy | ContextMenuPolicy [get, set] |
More... | |
new bool | UpdatesEnabled [get, set] |
More... | |
virtual new bool | Visible [get, set] |
More... | |
new bool | Minimized [get] |
More... | |
new bool | Maximized [get] |
More... | |
new bool | FullScreen [get] |
More... | |
virtual new QSize | SizeHint [get] |
More... | |
virtual new QSize | MinimumSizeHint [get] |
More... | |
new bool | AcceptDrops [get, set] |
More... | |
new string | WindowTitle [get, set] |
More... | |
new QIcon | WindowIcon [get, set] |
More... | |
new string | WindowIconText [get, set] |
More... | |
new double | WindowOpacity [get, set] |
More... | |
new bool | WindowModified [get, set] |
More... | |
new string | ToolTip [get, set] |
More... | |
new string | StatusTip [get, set] |
More... | |
new string | WhatsThis [get, set] |
More... | |
new string | AccessibleName [get, set] |
More... | |
new string | AccessibleDescription [get, set] |
More... | |
new Qt.LayoutDirection | LayoutDirection [get, set] |
More... | |
new bool | AutoFillBackground [get, set] |
More... | |
new string | StyleSheet [get, set] |
More... | |
new QLocale | Locale [get, set] |
More... | |
new string | WindowFilePath [get, set] |
More... | |
new Qt.InputMethodHint | InputMethodHints [get, set] |
More... | |
static new QMetaObject | StaticMetaObject [get] |
new ushort | Painters [get, set] |
new IQWidgetSignals | Emit [get] |
![]() | |
virtual EventHandler < QEventArgs< QChildEvent > > | ChildEvent |
More... | |
virtual EventHandler < QEventArgs< QEvent > > | CustomEvent |
More... | |
virtual EventHandler < QEventArgs< QEvent > > | Event |
More... | |
virtual EventHandler < QEventArgs< QTimerEvent > > | TimerEvent |
More... | |
Slot< QObject > | DestroyedObj |
More... | |
Slot | Destroyed |
More... | |
QObject | Parent [get, set] |
More... | |
System.Collections.Generic.List < QObject > | Children [get] |
More... | |
System.Collections.Generic.List < QByteArray > | DynamicPropertyNames [get] |
More... | |
bool | IsWidgetType [get] |
More... | |
static uint | RegisterUserData [get] |
QObject | Sender [get] |
More... | |
int | SenderSignalIndex [get] |
More... | |
bool | SignalsBlocked [get] |
More... | |
virtual System.IntPtr | SmokeObject [get, set] |
new string | ObjectName [get, set] |
More... | |
static new QMetaObject | StaticMetaObject [get] |
More... | |
static new QMetaObject | StaticQtMetaObject [get] |
new IQObjectSignals | Emit [get] |
![]() | |
static string | QAppName [get] |
static double | QInf [get] |
static double | QQNaN [get] |
static double | QSNaN [get] |
static bool | QSharedBuild [get] |
static string | QVersion [get] |
More... | |
static int | Qrand [get] |
More... | |
![]() | |
System.Int32 | ColorCount [get] |
More... | |
System.Int32 | Depth [get] |
More... | |
System.Int32 | DevType [get] |
System.Int32 | Height [get] |
More... | |
System.Int32 | HeightMM [get] |
More... | |
System.Int32 | LogicalDpiX [get] |
More... | |
System.Int32 | LogicalDpiY [get] |
More... | |
System.Int32 | NumColors [get] |
More... | |
QPaintEngine | PaintEngine [get] |
More... | |
System.Boolean | PaintingActive [get] |
More... | |
System.Int32 | PhysicalDpiX [get] |
More... | |
System.Int32 | PhysicalDpiY [get] |
More... | |
System.Int32 | Width [get] |
More... | |
System.Int32 | WidthMM [get] |
More... | |
Additional Inherited Members | |
![]() | |
</para > *< para > Creating QM files suitable for use with this[SmokeMethod("qtTrId(const char*, int)")] static strin | QtTrId )(string id, int n=-1) |
![]() | |
object | Q_EMIT = null |
SmokeInvocation | interceptor |
readonly List< QEventHandler > | eventFilters = new List<QEventHandler>() |
The QMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer.
A message box displays a primary text to alert the user to a situation, an informative text to further explain the alert or to ask the user a question, and an optional detailed text to provide even more data if the user requests it. A message box can also display an icon and standard buttons for accepting a user response.
Two APIs for using QMessageBox are provided, the property-based API, and the static functions. Calling one of the static functions is the simpler approach, but it is less flexible than using the property-based API, and the result is less informative. Using the property-based API is recommended.
The Property-based API
To use the property-based API, construct an instance of QMessageBox, set the desired properties, and call exec() to show the message. The simplest configuration is to set only the message text property.
QMessageBox msgBox;
msgBox.setText("The document has been modified.");
msgBox.exec();
The user must click the OK button to dismiss the message box. The rest of the GUI is blocked until the message box is dismissed.
A better approach than just alerting the user to an event is to also ask the user what to do about it. Store the question in the informative text property, and set the standard buttons property to the set of buttons you want as the set of user responses. The buttons are specified by combining values from StandardButtons using the bitwise OR operator. The display order for the buttons is platform-dependent. For example, on Windows, Save is displayed to the left of Cancel, whereas on Mac OS, the order is reversed.
Mark one of your standard buttons to be your default button.
QMessageBox msgBox;
msgBox.setText("The document has been modified.");
msgBox.setInformativeText("Do you want to save your changes?");
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Save);
int ret = msgBox.exec();
This is the approach recommended in the Mac OS X Guidelines. Similar guidelines apply for the other platforms, but note the different ways the informative text is handled for different platforms.
The exec() slot returns the StandardButtons value of the button that was clicked.
switch (ret) {
case QMessageBox::Save:
// Save was clicked
break;
case QMessageBox::Discard:
// Don't Save was clicked
break;
case QMessageBox::Cancel:
// Cancel was clicked
break;
default:
// should never be reached
break;
}
To give the user more information to help him answer the question, set the detailed text property. If the detailed text property is set, the Show Details... button will be shown.
Clicking the Show Details... button displays the detailed text.
Rich Text and the Text Format Property
The detailed text property is always interpreted as plain text. The main text and informative text properties can be either plain text or rich text. These strings are interpreted according to the setting of the text format property. The default setting is auto-text.
Note that for some plain text strings containing XML meta-characters, the auto-text rich text detection test may fail causing your plain text string to be interpreted 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 property explicitly with setTextFormat().
Severity Levels and the Icon and Pixmap Properties
QMessageBox supports four predefined message severity levels, or message types, which really only differ in the predefined icon they each show. Specify one of the four predefined message types by setting the icon property to one of the predefined icons. The following rules are guidelines:
Question For asking a question during normal operations.
Information For reporting information about normal operations.
Warning For reporting non-critical errors.
Critical For reporting critical errors.
Predefined icons are not defined by QMessageBox, but provided by the style. The default value is No Icon. The message boxes are otherwise the same for all cases. When using a standard icon, use the one recommended in the table, or use the one recommended by the style guidelines for your platform. If none of the standard icons is right for your message box, you can use a custom icon by setting the icon pixmap property instead of setting the icon property.
In summary, to set an icon, use either setIcon() for one of the standard icons, or setIconPixmap() for a custom icon.
The Static Functions API
Building message boxes with the static functions API, although convenient, is less flexible than using the property-based API, because the static function signatures lack parameters for setting the informative text and detailed text properties. One work-around for this has been to use the title parameter as the message box main text and the text parameter as the message box informative text. Because this has the obvious drawback of making a less readable message box, platform guidelines do not recommend it. The Microsoft Windows User Interface Guidelines recommend using the application name as the window's title, which means that if you have an informative text in addition to your main text, you must concatenate it to the text parameter.
Note that the static function signatures have changed with respect to their button parameters, which are now used to set the standard buttons and the default button.
Static functions are available for creating information(), question(), warning(), and critical() message boxes.
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
The Standard Dialogs example shows how to use QMessageBox and the other built-in Qt dialogs.
Advanced Usage
If the standard buttons are not flexible enough for your message box, you can use the addButton() overload that takes a text and a ButtonRoleto to add custom buttons. The ButtonRole is used by QMessageBox to determine the ordering of the buttons on screen (which varies according to the platform). 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
}
Default and Escape Keys
The default button (i.e., the button activated when Enter is pressed) can be specified using setDefaultButton(). If a default button is not specified, QMessageBox tries to find one based on the button roles of the buttons used in the message box.
The escape button (the button activated when Esc is pressed) can be specified using setEscapeButton(). If an escape button is not specified, QMessageBox tries to find one using these rules:
If there is only one button, it is the button activated when Esc is pressed.
If there is a Cancel button, it is the button activated when Esc is pressed.
If there is exactly one button having either the Reject role or the the No role, it is the button activated when Esc is pressed.
When an escape button can't be determined using these rules, pressing Esc has no effect.
See also QDialogButtonBox, GUI Design Handbook: Message Box, Standard Dialogs Example, and Application Example.
This enum describes the roles that can be used to describe buttons in the button box. Combinations of these roles are as flags used to describe different aspects of their behavior.
See also StandardButton.
This enum has the following values:
These enums describe flags for standard buttons. Each button has a defined ButtonRole.
The following values are obsolete:
This enum was introduced or modified in Qt 4.2.
See also ButtonRole and standardButtons.
Enumerator | |
---|---|
Abort |
An "Abort" button defined with the RejectRole. |
Apply |
An "Apply" button defined with the ApplyRole. |
ButtonMask | |
Cancel |
A "Cancel" button defined with the RejectRole. |
Close |
A "Close" button defined with the RejectRole. |
Default |
Use the defaultButton argument of information(), warning(), etc. instead, or call setDefaultButton(). |
Discard |
A "Discard" or "Don't Save" button, depending on the platform, defined with the DestructiveRole. |
Escape |
Call setEscapeButton() instead. |
FirstButton | |
FlagMask | |
Help |
A "Help" button defined with the HelpRole. |
Ignore |
An "Ignore" button defined with the AcceptRole. |
LastButton | |
No |
A "No" button defined with the NoRole. |
NoAll |
Use NoToAll instead. |
NoButton |
An invalid button. |
NoToAll |
A "No to All" button defined with the NoRole. |
Ok |
An "OK" button defined with the AcceptRole. |
Open |
A "Open" button defined with the AcceptRole. |
Reset |
A "Reset" button defined with the ResetRole. |
RestoreDefaults |
A "Restore Defaults" button defined with the ResetRole. |
Retry |
A "Retry" button defined with the AcceptRole. |
Save |
A "Save" button defined with the AcceptRole. |
SaveAll |
A "Save All" button defined with the AcceptRole. |
Yes |
A "Yes" button defined with the YesRole. |
YesAll |
Use YesToAll instead. |
YesToAll |
A "Yes to All" button defined with the YesRole. |
|
protected |
QtGui.QMessageBox.QMessageBox | ( | QWidget | parent = null | ) |
Constructs a message box with no text and no buttons. parent is passed to the QDialog constructor.
On Mac OS X, if you want your message box to appear as a Qt::Sheet of its parent, set the message box's window modality to Qt::WindowModal or use open(). Otherwise, the message box will be a standard dialog.
QtGui.QMessageBox.QMessageBox | ( | QMessageBox.Icon | icon, |
string | title, | ||
string | text, | ||
QMessageBox.StandardButton | buttons = QMessageBox.StandardButton.NoButton , |
||
QWidget | parent = null , |
||
Qt.WindowType | flags = Qt.WindowType.Dialog|Qt.WindowType.MSWindowsFixedSizeDialogHint |
||
) |
Constructs a message box with the given icon, title, text, and standard buttons. Standard or custom buttons can be added at any time using addButton(). The parent and f arguments are passed to the QDialog constructor.
The message box is an application modal dialog box.
On Mac OS X, if parent is not 0 and you want your message box to appear as a Qt::Sheet of that parent, set the message box's window modality to Qt::WindowModal (default). Otherwise, the message box will be a standard dialog.
See also setWindowTitle(), setText(), setIcon(), and setStandardButtons().
QtGui.QMessageBox.QMessageBox | ( | string | title, |
string | text, | ||
QMessageBox.Icon | icon, | ||
int | button0, | ||
int | button1, | ||
int | button2, | ||
QWidget | parent = null , |
||
Qt.WindowType | f = Qt.WindowType.Dialog|Qt.WindowType.MSWindowsFixedSizeDialogHint |
||
) |
Constructs a message box with a title, a text, an icon, and up to three buttons.
The icon must be one of the following:
Each button, button0, button1 and button2, can have one of the following values:
Use QMessageBox::NoButton for the later parameters to have fewer than three buttons in your message box. If you don't specify any buttons at all, QMessageBox will provide an Ok button.
One of the buttons can be OR-ed with the QMessageBox::Default flag to make it the default button (clicked when Enter is pressed).
One of the buttons can be OR-ed with the QMessageBox::Escape flag to make it the cancel or close button (clicked when Esc is pressed).
QMessageBox mb("Application Name",
"Hardware failure.\n\nDisk error detected\nDo you want to stop?",
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No | QMessageBox::Escape,
if (mb.exec() == QMessageBox::No) {
// try again
The message box is an application modal dialog box.
The parent and f arguments are passed to the QDialog constructor.
See also setWindowTitle(), setText(), and setIcon().
|
static |
Displays a simple about box with title title and text text. The about box's parent is parent.
about() looks for a suitable icon in four locations:
It prefers parent->icon() if that exists.
If not, it tries the top-level widget containing parent.
If that fails, it tries the active window.
As a last resort it uses the Information icon.
The about box has a single button labelled "OK". On Mac OS X, the about box is popped up as a modeless window; on other platforms, it is currently application modal.
See also QWidget::windowIcon() and QApplication::activeWindow().
|
static |
Displays a simple message box about Qt, with the given title and centered over parent (if parent is not 0). The message includes the version number of Qt being used by the application.
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.
On Mac OS X, the about box is popped up as a modeless window; on other platforms, it is currently application modal.
See also QApplication::aboutQt().
new void QtGui.QMessageBox.AddButton | ( | QAbstractButton | button, |
QMessageBox.ButtonRole | role | ||
) |
Adds the given button to the message box with the specified role.
This function was introduced in Qt 4.2.
See also removeButton(), button(), and setStandardButtons().
new QPushButton QtGui.QMessageBox.AddButton | ( | QMessageBox.StandardButton | button | ) |
This is an overloaded function.
Adds a standard button to the message box if it is valid to do so, and returns the push button.
This function was introduced in Qt 4.2.
See also setStandardButtons().
new QPushButton QtGui.QMessageBox.AddButton | ( | string | text, |
QMessageBox.ButtonRole | role | ||
) |
This is an overloaded function.
Creates a button with the given text, adds it to the message box for the specified role, and returns it.
This function was introduced in Qt 4.2.
new QAbstractButton QtGui.QMessageBox.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.
This function was introduced in Qt 4.2.
See also standardButtons and standardButton().
new QMessageBox.ButtonRole QtGui.QMessageBox.buttonRole | ( | QAbstractButton | button | ) |
Returns the button role for the specified button. This function returns InvalidRole if button is 0 or has not been added to the message box.
This function was introduced in Qt 4.5.
See also buttons() and addButton().
new string QtGui.QMessageBox.ButtonText | ( | int | button | ) |
Returns the text of the message box button button, or an empty string if the message box does not contain the button.
Use button() and QPushButton::text() instead.
See also setButtonText().
|
virtual |
|
static |
Opens a critical message box with the given title and text in front of the specified parent widget.
The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.
Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
This function was introduced in Qt 4.2.
See also question(), warning(), and information().
|
static |
Opens a critical message box with the given title and text. The dialog may have up to three buttons. Each of the button parameters, button0, button1 and button2 may be set to one of the following values:
If you don't want all three buttons, set the last button, or last two buttons to QMessageBox::NoButton.
One button can be OR-ed with QMessageBox::Default, and one button can be OR-ed with QMessageBox::Escape.
Returns the identity (QMessageBox::Ok, or QMessageBox::No, etc.) of the button that was clicked.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also information(), question(), and warning().
|
static |
This is an overloaded function.
Displays a critical error message box with the given title and text, as well as one, two, or three buttons. Returns the number of the button that was clicked (0, 1 or 2).
button0Text is the text of the first button, and is optional. If button0Text is not supplied, "OK" (translated) will be used. button1Text is the text of the second button, and is optional, and button2Text is the text of the third button, and is optional. defaultButtonNumber (0, 1 or 2) is the index of the default button; pressing Return or Enter is the same as clicking the default button. It defaults to 0 (the first button). escapeButtonNumber is the index of the Escape button; pressing Escape is the same as clicking this button. It defaults to -1; supply 0, 1, or 2 to make pressing Escape equivalent to clicking the relevant button.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also information(), question(), and warning().
new void QtGui.QMessageBox.Dispose | ( | ) |
|
static |
Opens an information message box with the given title and text in front of the specified parent widget.
The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.
Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
This function was introduced in Qt 4.2.
See also question(), warning(), and critical().
|
static |
Opens an information message box with the given title and the text. The dialog may have up to three buttons. Each of the buttons, button0, button1 and button2 may be set to one of the following values:
If you don't want all three buttons, set the last button, or last two buttons to QMessageBox::NoButton.
One button can be OR-ed with QMessageBox::Default, and one button can be OR-ed with QMessageBox::Escape.
Returns the identity (QMessageBox::Ok, or QMessageBox::No, etc.) of the button that was clicked.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also question(), warning(), and critical().
|
static |
This is an overloaded function.
Displays an information message box with the given title and text, as well as one, two or three buttons. Returns the index of the button that was clicked (0, 1 or 2).
button0Text is the text of the first button, and is optional. If button0Text is not supplied, "OK" (translated) will be used. button1Text is the text of the second button, and is optional. button2Text is the text of the third button, and is optional. defaultButtonNumber (0, 1 or 2) is the index of the default button; pressing Return or Enter is the same as clicking the default button. It defaults to 0 (the first button). escapeButtonNumber is the index of the escape button; pressing Esc is the same as clicking this button. It defaults to -1; supply 0, 1 or 2 to make pressing Esc equivalent to clicking the relevant button.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also question(), warning(), and critical().
|
protected |
This signal is emitted whenever a button is clicked inside the QMessageBox. The button that was clicked in returned in button.
|
protectedvirtual |
Reimplemented from QWidget::changeEvent().
Reimplemented from QtGui.QWidget.
|
protectedvirtual |
Reimplemented from QWidget::closeEvent().
Reimplemented from QtGui.QWidget.
|
virtual |
Reimplemented from QObject::event().
Reimplemented from QtCore.QObject.
|
protectedvirtual |
Reimplemented from QWidget::keyPressEvent().
Reimplemented from QtGui.QWidget.
|
protectedvirtual |
Reimplemented from QWidget::resizeEvent().
Reimplemented from QtGui.QDialog.
|
protectedvirtual |
Reimplemented from QWidget::showEvent().
Reimplemented from QtGui.QDialog.
new void QtGui.QMessageBox.Open | ( | ) |
new void QtGui.QMessageBox.Open | ( | QObject | receiver, |
string | member | ||
) |
This is an overloaded function.
Opens the dialog and connects its finished() or buttonClicked() signal to the slot specified by receiver and member. If the slot in member has a pointer for its first parameter the connection is to buttonClicked(), otherwise the connection is to finished().
The signal will be disconnected from the slot when the dialog is closed.
|
static |
Opens a question message box with the given title and text in front of the specified parent widget.
The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.
Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
This function was introduced in Qt 4.2.
See also information(), warning(), and critical().
|
static |
Opens a question message box with the given title and text. The dialog may have up to three buttons. Each of the buttons, button0, button1 and button2 may be set to one of the following values:
If you don't want all three buttons, set the last button, or last two buttons to QMessageBox::NoButton.
One button can be OR-ed with QMessageBox::Default, and one button can be OR-ed with QMessageBox::Escape.
Returns the identity (QMessageBox::Yes, or QMessageBox::No, etc.) of the button that was clicked.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also information(), warning(), and critical().
|
static |
This is an overloaded function.
Displays a question message box with the given title and text, as well as one, two or three buttons. Returns the index of the button that was clicked (0, 1 or 2).
button0Text is the text of the first button, and is optional. If button0Text is not supplied, "OK" (translated) will be used. button1Text is the text of the second button, and is optional. button2Text is the text of the third button, and is optional. defaultButtonNumber (0, 1 or 2) is the index of the default button; pressing Return or Enter is the same as clicking the default button. It defaults to 0 (the first button). escapeButtonNumber is the index of the Escape button; pressing Escape is the same as clicking this button. It defaults to -1; supply 0, 1 or 2 to make pressing Escape equivalent to clicking the relevant button.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also information(), warning(), and critical().
new void QtGui.QMessageBox.RemoveButton | ( | QAbstractButton | button | ) |
Removes button from the button box without deleting it.
This function was introduced in Qt 4.2.
See also addButton() and setStandardButtons().
new void QtGui.QMessageBox.SetButtonText | ( | int | button, |
string | text | ||
) |
Sets the text of the message box button button to text. Setting the text of a button that is not in the message box is silently ignored.
Use addButton() instead.
See also buttonText().
new void QtGui.QMessageBox.SetDefaultButton | ( | QMessageBox.StandardButton | button | ) |
Sets the message box's default button to button.
This function was introduced in Qt 4.3.
See also addButton() and QPushButton::setDefault().
new void QtGui.QMessageBox.SetEscapeButton | ( | QMessageBox.StandardButton | button | ) |
Sets the buttons that gets activated when the Escape key is pressed to button.
This function was introduced in Qt 4.3.
See also addButton() and clickedButton().
new void QtGui.QMessageBox.SetWindowModality | ( | Qt.WindowModality | windowModality | ) |
This function shadows QWidget::setWindowModality().
Sets the modality of the message box to windowModality.
On Mac OS X, if the modality is set to Qt::WindowModal and the message box has a parent, then the message box will be a Qt::Sheet, otherwise the message box will be a standard dialog.
This function was introduced in Qt 4.2.
new void QtGui.QMessageBox.SetWindowTitle | ( | string | title | ) |
This function shadows QWidget::setWindowTitle().
Sets the title of the message box to title. On Mac OS X, the window title is ignored (as required by the Mac OS X Guidelines).
This function was introduced in Qt 4.2.
new QMessageBox.StandardButton QtGui.QMessageBox.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.
This function was introduced in Qt 4.2.
See also button() and standardButtons().
|
static |
Returns the pixmap used for a standard icon. This allows the pixmaps to be used in more complex message boxes. icon specifies the required icon, e.g. QMessageBox::Question, QMessageBox::Information, QMessageBox::Warning or QMessageBox::Critical.
Call QStyle::standardIcon() with QStyle::SP_MessageBoxInformation etc. instead.
|
static |
|
static |
|
static |
|
static |
|
static |
Opens a warning message box with the given title and text in front of the specified parent widget.
The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.
Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
This function was introduced in Qt 4.2.
See also question(), information(), and critical().
|
static |
Opens a warning message box with the given title and text. The dialog may have up to three buttons. Each of the button parameters, button0, button1 and button2 may be set to one of the following values:
If you don't want all three buttons, set the last button, or last two buttons to QMessageBox::NoButton.
One button can be OR-ed with QMessageBox::Default, and one button can be OR-ed with QMessageBox::Escape.
Returns the identity (QMessageBox::Ok or QMessageBox::No or ...) of the button that was clicked.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also information(), question(), and critical().
|
static |
This is an overloaded function.
Displays a warning message box with the given title and text, as well as one, two, or three buttons. Returns the number of the button that was clicked (0, 1, or 2).
button0Text is the text of the first button, and is optional. If button0Text is not supplied, "OK" (translated) will be used. button1Text is the text of the second button, and is optional, and button2Text is the text of the third button, and is optional. defaultButtonNumber (0, 1 or 2) is the index of the default button; pressing Return or Enter is the same as clicking the default button. It defaults to 0 (the first button). escapeButtonNumber is the index of the Escape button; pressing Escape is the same as clicking this button. It defaults to -1; supply 0, 1, or 2 to make pressing Escape equivalent to clicking the relevant button.
The message box is an application modal dialog box.
Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.
See also information(), question(), and critical().
|
addremove |
This signal is emitted whenever a button is clicked inside the QMessageBox. The button that was clicked in returned in button.
|
get |
Returns a list of all the buttons that have been added to the message box.
This function was introduced in Qt 4.5.
See also buttonRole(), addButton(), and removeButton().
|
get |
Returns the button that was clicked by the user, or 0 if the user hit the Esc key and no 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) {
...
}
This function was introduced in Qt 4.2.
See also standardButton() and button().
|
getset |
Returns the button that should be the message box's default button. Returns 0 if no default button was set.
This function was introduced in Qt 4.2.
Sets the message box's default button to button.
This function was introduced in Qt 4.2.
|
getset |
This property holds the text to be displayed in the details area.
The text will be interpreted as a plain text.
By default, this property contains an empty string.
This property was introduced in Qt 4.2.
|
getprotected |
|
getset |
Returns the button that is activated when escape is pressed.
By default, QMessageBox attempts to automatically detect an escape button as follows:
If there is only one button, it is made the escape button.
If there is a Cancel button, it is made the escape button.
On Mac OS X only, if there is exactly one button with the role QMessageBox::RejectRole, it is made the escape button.
When an escape button could not be automatically detected, pressing Esc has no effect.
This function was introduced in Qt 4.2.
Sets the button that gets activated when the Escape key is pressed to button.
This function was introduced in Qt 4.2.
|
getset |
This property holds the message box's icon.
The icon of the message box can be specified with one of the values:
The default is QMessageBox::NoIcon.
The pixmap used to display the actual icon depends on the current GUI style. You can also set a custom pixmap for the icon by setting the icon pixmap property.
|
getset |
This property holds the current icon.
The icon currently used by the message box. Note that it's often hard to draw one pixmap that looks appropriate in all GUI styles; you may want to supply a different pixmap for each platform.
By default, this property is undefined.
|
getset |
This property holds the informative text that provides a fuller description for the message.
Infromative text can be used to expand upon the 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.
By default, this property contains an empty string.
This property was introduced in Qt 4.2.
|
get |
|
getset |
This property holds collection of standard buttons in the message box.
This property controls which standard buttons are used by the message box.
By default, this property contains no standard buttons.
This property was introduced in Qt 4.2.
|
staticget |
|
getset |
This property holds the message box text to be displayed.
The text will be interpreted either as a plain text or as rich text, depending on the text format setting (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.
|
getset |
This property holds the format of the text displayed by the message box.
The current text format used by the message box. See the Qt::TextFormat enum for an explanation of the possible options.
The default format is Qt::AutoText.