Qyoto
4.0.5
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... | |
Public Types inherited from QtGui.QDialog | |
enum | DialogCode { Accepted = 1, Rejected = 0 } |
More... | |
Public Types inherited from QtGui.QWidget | |
enum | RenderFlag { DrawChildren = 2, DrawWindowBackground = 1, IgnoreMask = 4 } |
More... | |
Public Member Functions | |
QMessageBox (QWidget parent=null) | |
| |
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) | |
| |
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) | |
| |
override void | CreateProxy () |
new void | AddButton (QAbstractButton button, QMessageBox.ButtonRole role) |
| |
new QPushButton | AddButton (QMessageBox.StandardButton button) |
| |
new QPushButton | AddButton (string text, QMessageBox.ButtonRole role) |
| |
new QAbstractButton | Button (QMessageBox.StandardButton which) |
| |
new QMessageBox.ButtonRole | buttonRole (QAbstractButton button) |
| |
new string | ButtonText (int button) |
| |
new System.Collections.Generic.List < QAbstractButton > | Buttons () |
| |
new QAbstractButton | ClickedButton () |
| |
override bool | OnEvent (QEvent e) |
| |
new void | Open () |
| |
new void | Open (QObject receiver, string member) |
| |
new void | RemoveButton (QAbstractButton button) |
| |
new void | SetButtonText (int button, string text) |
| |
new void | SetDefaultButton (QMessageBox.StandardButton button) |
| |
new void | SetEscapeButton (QMessageBox.StandardButton button) |
| |
new void | SetStandardButtons (QMessageBox.StandardButton buttons) |
new void | SetWindowModality (Qt.WindowModality windowModality) |
| |
new void | SetWindowTitle (string title) |
| |
override QSize | SizeHint () |
| |
new QMessageBox.StandardButton | standardButton (QAbstractButton button) |
| |
new QMessageBox.StandardButton | standardButtons () |
new void | Dispose () |
Public Member Functions inherited from QtGui.QDialog | |
QDialog (QWidget parent=null, Qt.WindowType f=0) | |
| |
virtual void | Accept () |
| |
virtual void | Done (int arg1) |
| |
override bool | EventFilter (QObject arg1, QEvent arg2) |
| |
new int | Exec () |
| |
override QSize | MinimumSizeHint () |
| |
new void | Open () |
| |
virtual void | Reject () |
| |
override void | SetVisible (bool visible) |
| |
new void | ShowExtension (bool arg1) |
| |
new void | Dispose () |
Public Member Functions inherited from QtGui.QWidget | |
QWidget (QWidget parent=null, Qt.WindowType f=0) | |
| |
override void | CreateProxy () |
new System.Collections.Generic.List < QAction > | Actions () |
| |
new void | ActivateWindow () |
| |
new void | AddAction (QAction action) |
| |
new void | AddActions (System.Collections.Generic.List< QAction > actions) |
| |
new void | AdjustSize () |
| |
new QWidget | ChildAt (QPoint p) |
| |
new QWidget | ChildAt (int x, int y) |
| |
new void | ClearFocus () |
| |
new void | ClearMask () |
| |
new bool | Close () |
| |
new QRect | ContentsRect () |
| |
new void | CreateWinId () |
virtual int | DevType () |
new NativeULong | EffectiveWinId () |
| |
new void | EnsurePolished () |
| |
override bool | OnEvent (QEvent arg1) |
| |
new QWidget | FocusWidget () |
| |
new QFont | font () |
new QFontInfo | FontInfo () |
| |
new QFontMetrics | FontMetrics () |
| |
new QRect | geometry () |
new void | GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom) |
| |
virtual System.IntPtr | GetDC () |
| |
new void | GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0) |
| |
new void | GrabKeyboard () |
| |
new void | GrabMouse () |
| |
new void | GrabMouse (QCursor arg1) |
| |
new int | GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut) |
| |
new QGraphicsProxyWidget | GraphicsProxyWidget () |
| |
virtual int | HeightForWidth (int arg1) |
| |
new void | Hide () |
| |
new Qt.InputMethodHint | inputMethodHints () |
virtual object | InputMethodQuery (Qt.InputMethodQuery arg1) |
| |
new void | InsertAction (QAction before, QAction action) |
| |
new void | InsertActions (QAction before, System.Collections.Generic.List< QAction > actions) |
| |
new NativeULong | InternalWinId () |
new bool | IsAncestorOf (QWidget child) |
| |
new bool | IsEnabledTo (QWidget arg1) |
| |
new bool | IsEnabledToTLW () |
| |
new bool | IsHidden () |
| |
new bool | IsLeftToRight () |
new bool | IsRightToLeft () |
new bool | IsTopLevel () |
| |
new bool | IsVisibleTo (QWidget arg1) |
| |
new bool | IsWindow () |
| |
new void | Lower () |
| |
new QPoint | MapFrom (QWidget arg1, QPoint arg2) |
| |
new QPoint | MapFromGlobal (QPoint arg1) |
| |
new QPoint | MapFromParent (QPoint arg1) |
| |
new QPoint | MapTo (QWidget arg1, QPoint arg2) |
| |
new QPoint | MapToGlobal (QPoint arg1) |
| |
new QPoint | MapToParent (QPoint arg1) |
| |
new void | Move (int x, int y) |
new QWidget | NativeParentWidget () |
| |
new QWidget | NextInFocusChain () |
| |
new void | OverrideWindowFlags (Qt.WindowType type) |
| |
new void | OverrideWindowState (Qt.WindowState state) |
virtual QPaintEngine | PaintEngine () |
| |
new QPalette | palette () |
new QWidget | ParentWidget () |
| |
new QWidget | PreviousInFocusChain () |
| |
new void | Raise () |
| |
virtual void | ReleaseDC (System.IntPtr arg1) |
| |
new void | ReleaseKeyboard () |
| |
new void | ReleaseMouse () |
| |
new void | ReleaseShortcut (int id) |
| |
new void | RemoveAction (QAction action) |
| |
new void | Render (IQPaintDevice target) |
| |
new void | Render (QPainter painter) |
| |
new void | Render (IQPaintDevice target, QPoint targetOffset) |
| |
new void | Render (QPainter painter, QPoint targetOffset) |
| |
new void | Render (IQPaintDevice target, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren) |
| |
new void | Render (QPainter painter, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren) |
| |
new void | Repaint () |
| |
new void | Repaint (QRect arg1) |
| |
new void | Repaint (QRegion arg1) |
| |
new void | Repaint (int x, int y, int w, int h) |
| |
new void | Resize (int w, int h) |
new bool | RestoreGeometry (QByteArray geometry) |
| |
new QByteArray | SaveGeometry () |
| |
new void | Scroll (int dx, int dy) |
| |
new void | Scroll (int dx, int dy, QRect arg3) |
| |
new void | SetAttribute (Qt.WidgetAttribute arg1, bool on=true) |
| |
new void | SetBaseSize (int basew, int baseh) |
new void | SetContentsMargins (int left, int top, int right, int bottom) |
| |
new void | SetDisabled (bool arg1) |
| |
new void | SetFixedHeight (int h) |
| |
new void | SetFixedSize (QSize arg1) |
| |
new void | SetFixedSize (int w, int h) |
| |
new void | SetFixedWidth (int w) |
| |
new void | SetFocus () |
| |
new void | SetFocus (Qt.FocusReason reason) |
| |
new void | SetGeometry (int x, int y, int w, int h) |
new void | SetHidden (bool hidden) |
| |
new void | SetInputMethodHints (Qt.InputMethodHint hints) |
new void | SetMask (QBitmap arg1) |
| |
new void | SetMaximumSize (int maxw, int maxh) |
new void | SetMinimumSize (int minw, int minh) |
new void | SetParent (QWidget parent) |
| |
new void | SetParent (QWidget parent, Qt.WindowType f) |
| |
new void | SetShortcutAutoRepeat (int id, bool enable=true) |
| |
new void | SetShortcutEnabled (int id, bool enable=true) |
| |
new void | SetShown (bool shown) |
new void | SetSizeIncrement (int w, int h) |
new void | SetSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical) |
new void | Show () |
| |
new void | ShowFullScreen () |
| |
new void | ShowMaximized () |
| |
new void | ShowMinimized () |
| |
new void | ShowNormal () |
| |
new void | StackUnder (QWidget arg1) |
| |
new bool | TestAttribute (Qt.WidgetAttribute arg1) |
| |
new QWidget | TopLevelWidget () |
| |
new bool | UnderMouse () |
| |
new void | UngrabGesture (Qt.GestureType type) |
| |
new void | UnsetCursor () |
new void | UnsetLayoutDirection () |
new void | UnsetLocale () |
new void | Update () |
| |
new void | Update (QRect arg1) |
| |
new void | Update (QRegion arg1) |
| |
new void | Update (int x, int y, int w, int h) |
| |
new void | UpdateGeometry () |
| |
new QRegion | VisibleRegion () |
| |
new NativeULong | WinId () |
| |
new QWidget | Window () |
| |
new Qt.WindowType | WindowType () |
| |
new void | Dispose () |
new int | ColorCount () |
new int | Depth () |
new int | HeightMM () |
new int | LogicalDpiX () |
new int | LogicalDpiY () |
new int | NumColors () |
new bool | PaintingActive () |
new int | PhysicalDpiX () |
new int | PhysicalDpiY () |
new int | WidthMM () |
Public Member Functions inherited from QtCore.QObject | |
QObject (QObject parent=null) | |
| |
new bool | BlockSignals (bool b) |
| |
new System.Collections.Generic.List < QObject > | Children () |
| |
new bool | Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
new void | DeleteLater () |
| |
new bool | Disconnect (QObject receiver, string member=null) |
| |
new bool | Disconnect (string signal=null, QObject receiver=null, string member=null) |
| |
new void | DumpObjectInfo () |
| |
new void | DumpObjectTree () |
| |
new System.Collections.Generic.List < QByteArray > | DynamicPropertyNames () |
| |
new bool | Inherits (string classname) |
| |
new void | InstallEventFilter (QObject arg1) |
| |
new bool | IsWidgetType () |
| |
new void | KillTimer (int id) |
| |
new object | Property (string name) |
| |
new void | RemoveEventFilter (QObject arg1) |
| |
new bool | SetProperty (string name, object value) |
| |
new void | SetUserData (uint id, QObjectUserData data) |
new bool | SignalsBlocked () |
| |
new int | StartTimer (int interval) |
| |
new QObjectUserData | UserData (uint id) |
new void | Dispose () |
Public Member Functions inherited from QtCore.Qt | |
delegate QTextStream | FuncQTextStreamQTextStream (QTextStream qTextStream) |
delegate string | FuncStringQByteArray (QByteArray qByteArray) |
delegate QByteArray | FuncQByteArrayString (string @string) |
delegate void | ActionQtMsgTypeString (QtMsgType qtMsgType, string @string) |
delegate QObject | FuncQObject () |
Public Member Functions inherited from QtGui.IQPaintDevice | |
new int | ColorCount () |
new int | Depth () |
int | DevType () |
System.IntPtr | GetDC () |
new int | Height () |
new int | HeightMM () |
new int | LogicalDpiX () |
new int | LogicalDpiY () |
new int | NumColors () |
QPaintEngine | PaintEngine () |
new bool | PaintingActive () |
new int | PhysicalDpiX () |
new int | PhysicalDpiY () |
void | ReleaseDC (System.IntPtr hdc) |
new int | Width () |
new int | WidthMM () |
Static Public Member Functions | |
static void | About (QWidget parent, string title, string text) |
| |
static void | AboutQt (QWidget parent, string title="") |
| |
static QMessageBox.StandardButton | Critical (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
| |
static int | Critical (QWidget parent, string title, string text, int button0, int button1, int button2=0) |
| |
static int | Critical (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
| |
static QMessageBox.StandardButton | Information (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
| |
static int | Information (QWidget parent, string title, string text, int button0, int button1=0, int button2=0) |
| |
static int | Information (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
| |
static QMessageBox.StandardButton | Question (QWidget parent, string title, string text, QMessageBox.StandardButton buttons=QMessageBox.StandardButton.Ok, QMessageBox.StandardButton defaultButton=QMessageBox.StandardButton.NoButton) |
| |
static int | Question (QWidget parent, string title, string text, int button0, int button1=0, int button2=0) |
| |
static int | Question (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
| |
static QPixmap | StandardIcon (QMessageBox.Icon icon) |
| |
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) |
| |
static int | Warning (QWidget parent, string title, string text, int button0, int button1, int button2=0) |
| |
static int | Warning (QWidget parent, string title, string text, string button0Text, string button1Text="", string button2Text="", int defaultButtonNumber=0, int escapeButtonNumber=-1) |
| |
Static Public Member Functions inherited from QtGui.QDialog | |
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 Public Member Functions inherited from QtGui.QWidget | |
static QWidget | Find (NativeULong arg1) |
| |
static QWidget | KeyboardGrabber () |
| |
static QWidget | MouseGrabber () |
| |
static void | SetTabOrder (QWidget arg1, QWidget arg2) |
| |
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 Public Member Functions inherited from QtCore.QObject | |
static bool | Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
static bool | Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection) |
| |
static bool | Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member) |
| |
static bool | Disconnect (QObject sender, string signal, QObject receiver, string member) |
| |
static uint | RegisterUserData () |
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 Public Member Functions inherited from QtCore.Qt | |
static QDataStream | Write (QDataStream s, object p) |
static QDataStream | Write (QDataStream arg1, QSizeF arg2) |
static QTextStream | Write (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Write (QDataStream arg1, QPoint arg2) |
static QDataStream | Write (QDataStream arg1, QLineF arg2) |
static QDataStream | Write (QDataStream arg1, QPointF arg2) |
static QDataStream | Write (QDataStream arg1, QChar arg2) |
static QDataStream | Write (QDataStream arg1, QByteArray arg2) |
static QDataStream | Write (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Write (QDataStream arg1, QRectF arg2) |
static QDataStream | Write (QDataStream arg1, QDateTime arg2) |
static QDataStream | Write (QDataStream arg1, QUrl arg2) |
static QDataStream | Write (QDataStream arg1, QTime arg2) |
static QDataStream | Write (QDataStream arg1, QLocale arg2) |
static QDataStream | Write (QDataStream arg1, QBitArray arg2) |
static QDataStream | Write (QDataStream arg1, QUuid arg2) |
static QDataStream | Write (QDataStream arg1, QLine arg2) |
static QDataStream | Write (QDataStream arg1, QDate arg2) |
static QDataStream | Write (QDataStream @out, QRegExp regExp) |
static QDataStream | Write (QDataStream arg1, QRect arg2) |
static QDataStream | Write (QDataStream arg1, QSize arg2) |
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) |
static QDataStream | Read (QDataStream arg1, QChar arg2) |
static QDataStream | Read (QDataStream arg1, QLocale arg2) |
static QDataStream | Read (QDataStream arg1, QRect arg2) |
static QDataStream | Read (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Read (QDataStream arg1, QDate arg2) |
static QDataStream | Read (QDataStream arg1, QUrl arg2) |
static QDataStream | Read (QDataStream arg1, QUuid arg2) |
static QTextStream | Read (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Read (QDataStream arg1, QLineF arg2) |
static QDataStream | Read (QDataStream arg1, QRectF arg2) |
static QDataStream | Read (QDataStream arg1, QPointF arg2) |
static QDataStream | Read (QDataStream arg1, QLine arg2) |
static QDataStream | Read (QDataStream arg1, QBitArray arg2) |
static QDataStream | Read (QDataStream arg1, QSize arg2) |
static QDataStream | Read (QDataStream arg1, QDateTime arg2) |
static QDataStream | Read (QDataStream arg1, QTime arg2) |
static QDataStream | Read (QDataStream arg1, QPoint arg2) |
static QDataStream | Read (QDataStream @in, QRegExp regExp) |
static QDataStream | Read (QDataStream s, object p) |
static QDataStream | Read (QDataStream arg1, QByteArray arg2) |
static QDataStream | Read (QDataStream arg1, QSizeF arg2) |
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) |
static double | qAcos (double v) |
static void | qAddPostRoutine (System.Action arg1) |
static string | qAppName () |
static double | qAsin (double v) |
static double | qAtan (double v) |
static double | qAtan2 (double x, double y) |
static void | qBadAlloc () |
static int | qCeil (double v) |
static ushort | qChecksum (string s, uint len) |
static QByteArray | qCompress (QByteArray data) |
static QByteArray | qCompress (QByteArray data, int compressionLevel=-1) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1) |
static double | qCos (double v) |
static double | qExp (double v) |
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) |
static bool | qFuzzyCompare (double p1, double p2) |
static bool | qFuzzyCompare (float p1, float p2) |
static bool | qFuzzyIsNull (double d) |
static bool | qFuzzyIsNull (float f) |
static uint | qHash (QBitArray key) |
static uint | qHash (QChar key) |
static uint | qHash (QStringRef key) |
static uint | qHash (QUrl url) |
static uint | qHash (QPersistentModelIndex index) |
static uint | qHash (QByteArray key) |
static uint | qHash (QModelIndex index) |
static uint | qHash (uint key) |
static uint | qHash (sbyte key) |
static uint | qHash (byte key) |
static uint | qHash (short key) |
static uint | qHash (NativeLong key) |
static uint | qHash (ushort key) |
static uint | qHash (long key) |
static uint | qHash (ulong key) |
static uint | qHash (int key) |
static uint | qHash (string key) |
static uint | qHash (NativeULong key) |
static double | qInf () |
static Qt.ActionQtMsgTypeString | qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1) |
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) |
static double | qPow (double x, double y) |
static double | qQNaN () |
static void | qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function) |
static void | qRemovePostRoutine (System.Action arg1) |
static int | qRound (double d) |
static long | qRound64 (double d) |
static double | qSNaN () |
static bool | qSharedBuild () |
static double | qSin (double v) |
static double | qSqrt (double v) |
static bool | qStringComparisonHelper (QStringRef s1, string s2) |
static double | qTan (double v) |
static QByteArray | qUncompress (QByteArray data) |
static QByteArray | qUncompress (Pointer< byte > data, int nbytes) |
static string | qVersion () |
static void | Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size) |
static QByteArray | Qgetenv (string varName) |
static bool | Qputenv (string varName, QByteArray value) |
static int | Qrand () |
static void | Qsrand (uint seed) |
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) |
static Pointer< sbyte > | Qstrcpy (Pointer< sbyte > dst, string src) |
static Pointer< sbyte > | Qstrdup (string arg1) |
static int | Qstricmp (string arg1, string arg2) |
static uint | Qstrlen (string str) |
static int | Qstrncmp (string str1, string str2, uint len) |
static Pointer< sbyte > | Qstrncpy (Pointer< sbyte > dst, string src, uint len) |
static int | Qstrnicmp (string arg1, string arg2, uint len) |
static uint | Qstrnlen (string str, uint maxlen) |
static string | QtTrId (string id, int n=-1) |
Protected Member Functions | |
QMessageBox (System.Type dummy) | |
new void | OnButtonClicked (QAbstractButton button) |
| |
override void | OnChangeEvent (QEvent @event) |
| |
override void | OnCloseEvent (QCloseEvent @event) |
| |
override void | OnKeyPressEvent (QKeyEvent @event) |
| |
override void | OnResizeEvent (QResizeEvent @event) |
| |
override void | OnShowEvent (QShowEvent @event) |
| |
Protected Member Functions inherited from QtGui.QDialog | |
QDialog (System.Type dummy) | |
new void | OnAccepted () |
| |
new void | AdjustPosition (QWidget arg1) |
override void | OnCloseEvent (QCloseEvent arg1) |
| |
override void | OnContextMenuEvent (QContextMenuEvent arg1) |
| |
new void | OnFinished (int result) |
| |
override void | OnKeyPressEvent (QKeyEvent arg1) |
| |
new void | OnRejected () |
| |
override void | OnResizeEvent (QResizeEvent arg1) |
| |
override void | OnShowEvent (QShowEvent arg1) |
| |
Protected Member Functions inherited from QtGui.QWidget | |
QWidget (System.Type dummy) | |
virtual void | OnActionEvent (QActionEvent arg1) |
| |
virtual void | OnChangeEvent (QEvent arg1) |
| |
new void | Create () |
| |
new void | Create (NativeULong arg1, bool initializeWindow=true, bool destroyOldWindow=true) |
| |
new void | OnCustomContextMenuRequested (QPoint pos) |
| |
new void | Destroy (bool destroyWindow=true, bool destroySubWindows=true) |
| |
virtual void | OnDragEnterEvent (QDragEnterEvent arg1) |
| |
virtual void | OnDragLeaveEvent (QDragLeaveEvent arg1) |
| |
virtual void | OnDragMoveEvent (QDragMoveEvent arg1) |
| |
virtual void | OnDropEvent (QDropEvent arg1) |
| |
virtual void | EnabledChange (bool arg1) |
virtual void | OnEnterEvent (QEvent arg1) |
| |
virtual void | OnFocusInEvent (QFocusEvent arg1) |
| |
new bool | FocusNextChild () |
| |
virtual bool | FocusNextPrevChild (bool next) |
| |
virtual void | OnFocusOutEvent (QFocusEvent arg1) |
| |
new bool | FocusPreviousChild () |
| |
virtual void | FontChange (QFont arg1) |
virtual void | OnHideEvent (QHideEvent arg1) |
| |
virtual void | OnInputMethodEvent (QInputMethodEvent arg1) |
| |
virtual void | OnKeyReleaseEvent (QKeyEvent arg1) |
| |
virtual void | LanguageChange () |
| |
virtual void | OnLeaveEvent (QEvent arg1) |
| |
virtual int | Metric (QPaintDevice.PaintDeviceMetric arg1) |
| |
virtual void | OnMouseDoubleClickEvent (QMouseEvent arg1) |
| |
virtual void | OnMouseMoveEvent (QMouseEvent arg1) |
| |
virtual void | OnMousePressEvent (QMouseEvent arg1) |
| |
virtual void | OnMouseReleaseEvent (QMouseEvent arg1) |
| |
virtual void | OnMoveEvent (QMoveEvent arg1) |
| |
virtual void | OnPaintEvent (QPaintEvent arg1) |
| |
virtual void | PaletteChange (QPalette arg1) |
new void | ResetInputContext () |
| |
virtual void | StyleChange (QStyle arg1) |
virtual void | OnTabletEvent (QTabletEvent arg1) |
| |
new void | UpdateMicroFocus () |
| |
virtual void | OnWheelEvent (QWheelEvent arg1) |
| |
virtual void | WindowActivationChange (bool arg1) |
Protected Member Functions inherited from QtCore.QObject | |
QObject (System.Type dummy) | |
virtual void | OnChildEvent (QChildEvent arg1) |
| |
virtual void | ConnectNotify (string signal) |
| |
virtual void | OnCustomEvent (QEvent arg1) |
| |
new void | OnDestroyed (QObject arg1=null) |
| |
virtual void | DisconnectNotify (string signal) |
| |
new int | Receivers (string signal) |
| |
new QObject | Sender () |
| |
new int | SenderSignalIndex () |
| |
virtual void | OnTimerEvent (QTimerEvent arg1) |
| |
Properties | |
Slot< QAbstractButton > | ButtonClicked |
| |
new QPushButton | DefaultButton [get, set] |
| |
new QAbstractButton | EscapeButton [get, set] |
| |
new string | Text [get, set] |
| |
new Icon | icon [get, set] |
| |
new QPixmap | IconPixmap [get, set] |
| |
new Qt.TextFormat | TextFormat [get, set] |
| |
new StandardButton | StandardButtons [get, set] |
| |
new string | DetailedText [get, set] |
| |
new string | InformativeText [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
new IQMessageBoxSignals | Emit [get] |
Properties inherited from QtGui.QDialog | |
Slot< System.Int32 > | Finished |
| |
Slot | Accepted |
| |
Slot | Rejected |
| |
new QWidget | Extension [get, set] |
| |
new Qt.Orientation | Orientation [get, set] |
| |
new int | Result [get, set] |
| |
new bool | SizeGripEnabled [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
new IQDialogSignals | Emit [get] |
Properties inherited from QtGui.QWidget | |
virtual EventHandler < QEventArgs< QActionEvent > > | ActionEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | ChangeEvent |
| |
virtual EventHandler < QEventArgs< QCloseEvent > > | CloseEvent |
| |
virtual EventHandler < QEventArgs < QContextMenuEvent > > | ContextMenuEvent |
| |
virtual EventHandler < QEventArgs< QDragEnterEvent > > | DragEnterEvent |
| |
virtual EventHandler < QEventArgs< QDragLeaveEvent > > | DragLeaveEvent |
| |
virtual EventHandler < QEventArgs< QDragMoveEvent > > | DragMoveEvent |
| |
virtual EventHandler < QEventArgs< QDropEvent > > | DropEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | EnterEvent |
| |
virtual EventHandler < QEventArgs< QFocusEvent > > | FocusInEvent |
| |
virtual EventHandler < QEventArgs< QFocusEvent > > | FocusOutEvent |
| |
virtual EventHandler < QEventArgs< QHideEvent > > | HideEvent |
| |
virtual EventHandler < QEventArgs < QInputMethodEvent > > | InputMethodEvent |
| |
virtual EventHandler < QEventArgs< QKeyEvent > > | KeyPressEvent |
| |
virtual EventHandler < QEventArgs< QKeyEvent > > | KeyReleaseEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | LeaveEvent |
| |
virtual EventHandler < QEventArgs< QMouseEvent > > | MouseDoubleClickEvent |
| |
virtual EventHandler < QEventArgs< QMouseEvent > > | MouseMoveEvent |
| |
virtual EventHandler < QEventArgs< QMouseEvent > > | MousePressEvent |
| |
virtual EventHandler < QEventArgs< QMouseEvent > > | MouseReleaseEvent |
| |
virtual EventHandler < QEventArgs< QMoveEvent > > | MoveEvent |
| |
virtual EventHandler < QEventArgs< QPaintEvent > > | PaintEvent |
| |
virtual EventHandler < QEventArgs< QResizeEvent > > | ResizeEvent |
| |
virtual EventHandler < QEventArgs< QShowEvent > > | ShowEvent |
| |
virtual EventHandler < QEventArgs< QTabletEvent > > | TabletEvent |
| |
virtual EventHandler < QEventArgs< QWheelEvent > > | WheelEvent |
| |
Slot< QPoint > | CustomContextMenuRequested |
| |
new QPalette.ColorRole | BackgroundRole [get, set] |
| |
new QMargins | ContentsMargins [get, set] |
| |
new QWidget | FocusProxy [get, set] |
| |
new QPalette.ColorRole | ForegroundRole [get, set] |
| |
new QGraphicsEffect | GraphicsEffect [get, set] |
| |
new QInputContext | InputContext [get, set] |
| |
new QLayout | Layout [get, set] |
| |
new QRegion | Mask [get, set] |
| |
new QStyle | Style [get, set] |
| |
new Qt.WindowType | WindowFlags [get, set] |
new string | WindowRole [get, set] |
| |
new Qt.WindowState | WindowState [get, set] |
| |
new bool | Modal [get] |
| |
new Qt.WindowModality | WindowModality [get, set] |
| |
new bool | Enabled [get, set] |
| |
new QRect | Geometry [get, set] |
| |
new QRect | FrameGeometry [get] |
| |
new QRect | NormalGeometry [get] |
| |
new int | X [get] |
| |
new int | Y [get] |
| |
new QPoint | Pos [get, set] |
| |
new QSize | FrameSize [get] |
| |
new QSize | Size [get, set] |
| |
new int | Width [get] |
| |
new int | Height [get] |
| |
new QRect | Rect [get] |
| |
new QRect | ChildrenRect [get] |
| |
new QRegion | ChildrenRegion [get] |
| |
new QSizePolicy | SizePolicy [get, set] |
| |
new QSize | MinimumSize [get, set] |
| |
new QSize | MaximumSize [get, set] |
| |
new int | MinimumWidth [get, set] |
| |
new int | MinimumHeight [get, set] |
| |
new int | MaximumWidth [get, set] |
| |
new int | MaximumHeight [get, set] |
| |
new QSize | SizeIncrement [get, set] |
| |
new QSize | BaseSize [get, set] |
| |
new QPalette | Palette [get, set] |
| |
new QFont | Font [get, set] |
| |
new QCursor | Cursor [get, set] |
| |
new bool | MouseTracking [get, set] |
| |
new bool | IsActiveWindow [get] |
| |
new Qt.FocusPolicy | FocusPolicy [get, set] |
| |
new bool | Focus [get] |
| |
new Qt.ContextMenuPolicy | ContextMenuPolicy [get, set] |
| |
new bool | UpdatesEnabled [get, set] |
| |
new bool | Visible [get, set] |
| |
new bool | Minimized [get] |
| |
new bool | Maximized [get] |
| |
new bool | FullScreen [get] |
| |
new bool | AcceptDrops [get, set] |
| |
new string | WindowTitle [get, set] |
| |
new QIcon | WindowIcon [get, set] |
| |
new string | WindowIconText [get, set] |
| |
new double | WindowOpacity [get, set] |
| |
new bool | WindowModified [get, set] |
| |
new string | ToolTip [get, set] |
| |
new string | StatusTip [get, set] |
| |
new string | WhatsThis [get, set] |
| |
new string | AccessibleName [get, set] |
| |
new string | AccessibleDescription [get, set] |
| |
new Qt.LayoutDirection | LayoutDirection [get, set] |
| |
new bool | AutoFillBackground [get, set] |
| |
new string | StyleSheet [get, set] |
| |
new QLocale | Locale [get, set] |
| |
new string | WindowFilePath [get, set] |
| |
new Qt.InputMethodHint | InputMethodHints [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
new ushort | Painters [get, set] |
new IQWidgetSignals | Emit [get] |
Properties inherited from QtCore.QObject | |
virtual EventHandler < QEventArgs< QChildEvent > > | ChildEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | CustomEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | Event |
| |
virtual EventHandler < QEventArgs< QTimerEvent > > | TimerEvent |
| |
Slot< QObject > | DestroyedQObject |
Slot | Destroyed |
| |
new QObject | Parent [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
new string | ObjectName [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
| |
static new QMetaObject | StaticQtMetaObject [get] |
new IQObjectSignals | Emit [get] |
Additional Inherited Members | |
Protected Attributes inherited from QtCore.QObject | |
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
| QMessageBox::Cancel,
QMessageBox::Save);
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.
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 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 | ( | 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 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.
|
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 System.Collections.Generic.List<QAbstractButton> QtGui.QMessageBox.Buttons | ( | ) |
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().
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().
new QAbstractButton QtGui.QMessageBox.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.
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().
|
virtual |
Reimplemented from QtGui.QDialog.
|
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 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 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().
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 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 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().
|
protected |
This signal is emitted whenever a button is clicked inside the QMessageBox. The button that was clicked in returned in button.
|
protected |
Reimplemented from QWidget::changeEvent().
|
protected |
Reimplemented from QWidget::closeEvent().
|
virtual |
Reimplemented from QObject::event().
Reimplemented from QtCore.QObject.
|
protected |
Reimplemented from QWidget::keyPressEvent().
|
protected |
Reimplemented from QWidget::resizeEvent().
|
protected |
Reimplemented from QWidget::showEvent().
new void QtGui.QMessageBox.Open | ( | ) |
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.
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 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 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().
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.SetStandardButtons | ( | QMessageBox.StandardButton | buttons | ) |
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.
|
virtual |
Reimplemented from QWidget::sizeHint().
Reimplemented from QtGui.QDialog.
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().
new QMessageBox.StandardButton QtGui.QMessageBox.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 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 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().
|
addremove |
This signal is emitted whenever a button is clicked inside the QMessageBox. The button that was clicked in returned in 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:
QMessageBox::NoIcon
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.
|
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.