Qyoto  4.0.6
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QMessageBox Class Reference

The QMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer. More...

Inheritance diagram for QtGui.QMessageBox:
Collaboration diagram for QtGui.QMessageBox:

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)
 
 
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 SetWindowModality (Qt.WindowModality windowModality)
 
 
new void SetWindowTitle (string title)
 
 
new QMessageBox.StandardButton standardButton (QAbstractButton button)
 
 
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 r)
 
 
override bool EventFilter (QObject o, QEvent e)
 
 
new int Exec ()
 
 
new void Open ()
 
 
virtual void Reject ()
 
 
new void ShowExtension (bool showIt)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QWidget
 QWidget (QWidget parent=null, Qt.WindowType f=0)
 
 
override void CreateProxy ()
 
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 void CreateWinId ()
 
new void EnsurePolished ()
 
 
override bool OnEvent (QEvent @event)
 
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
 
 
new void GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0)
 
 
new void GrabKeyboard ()
 
 
new void GrabMouse ()
 
 
new void GrabMouse (QCursor cursor)
 
 
new int GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut)
 
 
virtual int HeightForWidth (int w)
 
 
new void Hide ()
 
 
virtual object InputMethodQuery (Qt.InputMethodQuery query)
 
 
new void InsertAction (QAction before, QAction action)
 
 
new void InsertActions (QAction before, System.Collections.Generic.List< QAction > actions)
 
 
new bool IsAncestorOf (QWidget child)
 
 
new bool IsEnabledTo (QWidget ancestor)
 
 
new bool IsVisibleTo (QWidget ancestor)
 
 
new void Lower ()
 
 
new QPoint MapFrom (QWidget parent, QPoint pos)
 
 
new QPoint MapFromGlobal (QPoint pos)
 
 
new QPoint MapFromParent (QPoint pos)
 
 
new QPoint MapTo (QWidget parent, QPoint pos)
 
 
new QPoint MapToGlobal (QPoint pos)
 
 
new QPoint MapToParent (QPoint pos)
 
 
new void Move (int x, int y)
 
new void OverrideWindowFlags (Qt.WindowType type)
 
 
new void OverrideWindowState (Qt.WindowState state)
 
new void Raise ()
 
 
virtual void ReleaseDC (System.IntPtr hdc)
 
 
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 rect)
 
 
new void Repaint (QRegion rgn)
 
 
new void Repaint (int x, int y, int w, int h)
 
 
new void Resize (int w, int h)
 
new bool RestoreGeometry (QByteArray geometry)
 
 
new void Scroll (int dx, int dy)
 
 
new void Scroll (int dx, int dy, QRect r)
 
 
new void SetAttribute (Qt.WidgetAttribute attribute, 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 disable)
 
 
new void SetFixedHeight (int h)
 
 
new void SetFixedSize (QSize s)
 
 
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 SetMask (QBitmap bitmap)
 
 
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 w)
 
 
new bool TestAttribute (Qt.WidgetAttribute attribute)
 
 
new void UngrabGesture (Qt.GestureType type)
 
 
new void UnsetCursor ()
 
new void UnsetLayoutDirection ()
 
new void UnsetLocale ()
 
new void Update ()
 
 
new void Update (QRect rect)
 
 
new void Update (QRegion rgn)
 
 
new void Update (int x, int y, int w, int h)
 
 
new void UpdateGeometry ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
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 ()
 
 
virtual bool EventFilter (QObject watched, QEvent @event)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject filterObj)
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject obj)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
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 void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
- Public Member Functions inherited from QtGui.IQPaintDevice
void ReleaseDC (System.IntPtr hdc)
 

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 id)
 
 
static void SetTabOrder (QWidget first, QWidget second)
 
 
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 type=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 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 stream, QSizeF size)
 
 
static QDataStream Write (QDataStream stream, QPoint point)
 
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream stream, QLineF line)
 
 
static QDataStream Write (QDataStream stream, QPointF point)
 
 
static QDataStream Write (QDataStream @out, QChar chr)
 
 
static QDataStream Write (QDataStream @out, QByteArray ba)
 
 
static QDataStream Write (QDataStream stream, QEasingCurve easing)
 
 
static QDataStream Write (QDataStream stream, QRectF rectangle)
 
 
static QDataStream Write (QDataStream @out, QDateTime dateTime)
 
 
static QDataStream Write (QDataStream @out, QUrl url)
 
 
static QDataStream Write (QDataStream @out, QTime time)
 
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream @out, QBitArray ba)
 
 
static QDataStream Write (QDataStream s, QUuid id)
 
 
static QDataStream Write (QDataStream stream, QLine line)
 
 
static QDataStream Write (QDataStream @out, QDate date)
 
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
 
static QDataStream Write (QDataStream stream, QRect rectangle)
 
 
static QDataStream Write (QDataStream stream, QSize size)
 
 
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 @in, QChar chr)
 
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream stream, QRect rectangle)
 
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream @in, QDate date)
 
 
static QDataStream Read (QDataStream @in, QUrl url)
 
 
static QDataStream Read (QDataStream s, QUuid id)
 
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream stream, QLineF line)
 
 
static QDataStream Read (QDataStream stream, QRectF rectangle)
 
 
static QDataStream Read (QDataStream stream, QPointF point)
 
 
static QDataStream Read (QDataStream stream, QLine line)
 
 
static QDataStream Read (QDataStream @in, QBitArray ba)
 
 
static QDataStream Read (QDataStream stream, QSize size)
 
 
static QDataStream Read (QDataStream @in, QDateTime dateTime)
 
 
static QDataStream Read (QDataStream @in, QTime time)
 
 
static QDataStream Read (QDataStream stream, QPoint point)
 
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream @in, QByteArray ba)
 
 
static QDataStream Read (QDataStream stream, QSizeF size)
 
 
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 ptr)
 
 
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, int compressionLevel=-1)
 
 
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 (char 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 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 void QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
 
static void QRemovePostRoutine (System.Action arg1)
 
static int QRound (double d)
 
static long QRound64 (double d)
 
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 void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
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 src)
 
 
static int Qstricmp (string str1, string str2)
 
 
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 str1, string str2, 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 e)
 
 
override void OnContextMenuEvent (QContextMenuEvent e)
 
 
new void OnFinished (int result)
 
 
override void OnKeyPressEvent (QKeyEvent e)
 
 
new void OnRejected ()
 
 
- Protected Member Functions inherited from QtGui.QWidget
 QWidget (System.Type dummy)
 
virtual void OnActionEvent (QActionEvent @event)
 
 
virtual void OnContextMenuEvent (QContextMenuEvent @event)
 
 
new void Create ()
 
 
new void Create (NativeULong window, bool initializeWindow=true, bool destroyOldWindow=true)
 
 
new void OnCustomContextMenuRequested (QPoint pos)
 
 
new void Destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
 
virtual void OnDragEnterEvent (QDragEnterEvent @event)
 
 
virtual void OnDragLeaveEvent (QDragLeaveEvent @event)
 
 
virtual void OnDragMoveEvent (QDragMoveEvent @event)
 
 
virtual void OnDropEvent (QDropEvent @event)
 
 
virtual void EnabledChange (bool arg1)
 
virtual void OnEnterEvent (QEvent @event)
 
 
virtual void OnFocusInEvent (QFocusEvent @event)
 
 
virtual bool FocusNextPrevChild (bool next)
 
 
virtual void OnFocusOutEvent (QFocusEvent @event)
 
 
virtual void FontChange (QFont arg1)
 
virtual void OnHideEvent (QHideEvent @event)
 
 
virtual void OnInputMethodEvent (QInputMethodEvent @event)
 
 
virtual void OnKeyReleaseEvent (QKeyEvent @event)
 
 
virtual void LanguageChange ()
 
 
virtual void OnLeaveEvent (QEvent @event)
 
 
virtual int Metric (QPaintDevice.PaintDeviceMetric m)
 
 
virtual void OnMouseDoubleClickEvent (QMouseEvent @event)
 
 
virtual void OnMouseMoveEvent (QMouseEvent @event)
 
 
virtual void OnMousePressEvent (QMouseEvent @event)
 
 
virtual void OnMouseReleaseEvent (QMouseEvent @event)
 
 
virtual void OnMoveEvent (QMoveEvent @event)
 
 
virtual void OnPaintEvent (QPaintEvent @event)
 
 
virtual void PaletteChange (QPalette arg1)
 
new void ResetInputContext ()
 
 
virtual void StyleChange (QStyle arg1)
 
virtual void OnTabletEvent (QTabletEvent @event)
 
 
new void UpdateMicroFocus ()
 
 
virtual void OnWheelEvent (QWheelEvent @event)
 
 
virtual void WindowActivationChange (bool arg1)
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent @event)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent @event)
 
 
new void OnDestroyed (QObject obj=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
virtual void OnTimerEvent (QTimerEvent @event)
 
 

Properties

Slot< QAbstractButtonButtonClicked
 
 
QPushButton DefaultButton [get, set]
 
 
QAbstractButton EscapeButton [get, set]
 
 
override QSize SizeHint [get]
 
System.Collections.Generic.List
< QAbstractButton
Buttons [get]
 
 
QAbstractButton ClickedButton [get]
 
 
new string Text [get, set]
 
 
new Icon icon [get, set]
 
 
new QPixmap IconPixmap [get, set]
 
 
new Qt.TextFormat TextFormat [get, set]
 
 
new QMessageBox.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
 
 
QWidget Extension [get, set]
 
 
Qt.Orientation Orientation [get, set]
 
 
int Result [get, set]
 
 
override bool Visible [get, set]
 
 
override QSize MinimumSizeHint [get]
 
 
override QSize SizeHint [get]
 
 
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< QPointCustomContextMenuRequested
 
 
QPalette.ColorRole BackgroundRole [get, set]
 
 
QMargins ContentsMargins [get, set]
 
 
QWidget FocusProxy [get, set]
 
 
QPalette.ColorRole ForegroundRole [get, set]
 
 
QGraphicsEffect GraphicsEffect [get, set]
 
 
QInputContext InputContext [get, set]
 
 
QLayout Layout [get, set]
 
 
QRegion Mask [get, set]
 
 
QStyle Style [get, set]
 
 
Qt.WindowType WindowFlags [get, set]
 
string WindowRole [get, set]
 
 
Qt.WindowState WindowState [get, set]
 
 
virtual int DevType [get]
 
virtual System.IntPtr GetDC [get]
 
 
virtual QPaintEngine PaintEngine [get]
 
 
int ColorCount [get]
 
int Depth [get]
 
int HeightMM [get]
 
int LogicalDpiX [get]
 
int LogicalDpiY [get]
 
int NumColors [get]
 
bool PaintingActive [get]
 
int PhysicalDpiX [get]
 
int PhysicalDpiY [get]
 
int WidthMM [get]
 
System.Collections.Generic.List
< QAction
Actions [get]
 
 
QRect ContentsRect [get]
 
 
NativeULong EffectiveWinId [get]
 
 
bool FocusNextChild [get]
 
 
bool FocusPreviousChild [get]
 
 
QWidget FocusWidget [get]
 
 
QFontInfo FontInfo [get]
 
 
QFontMetrics FontMetrics [get]
 
 
QGraphicsProxyWidget GraphicsProxyWidget [get]
 
 
NativeULong InternalWinId [get]
 
bool IsEnabledToTLW [get]
 
 
bool IsHidden [get]
 
 
bool IsLeftToRight [get]
 
bool IsRightToLeft [get]
 
bool IsTopLevel [get]
 
 
bool IsWindow [get]
 
 
static QWidget KeyboardGrabber [get]
 
 
virtual QSize MinimumSizeHint [get]
 
static QWidget MouseGrabber [get]
 
 
QWidget NativeParentWidget [get]
 
 
QWidget NextInFocusChain [get]
 
 
QWidget ParentWidget [get]
 
 
QWidget PreviousInFocusChain [get]
 
 
QByteArray SaveGeometry [get]
 
 
virtual QSize SizeHint [get]
 
QWidget TopLevelWidget [get]
 
 
bool UnderMouse [get]
 
 
QRegion VisibleRegion [get]
 
 
NativeULong WinId [get]
 
 
QWidget Window [get]
 
 
Qt.WindowType WindowType [get]
 
 
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]
 
 
virtual 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< QObjectDestroyedQObject
 
Slot Destroyed
 
 
QObject Parent [get, set]
 
 
System.Collections.Generic.List
< QObject
Children [get]
 
 
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames [get]
 
 
bool IsWidgetType [get]
 
 
static uint RegisterUserData [get]
 
QObject Sender [get]
 
 
int SenderSignalIndex [get]
 
 
bool SignalsBlocked [get]
 
 
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]
 
- Properties inherited from QtCore.Qt
static string QAppName [get]
 
static double QInf [get]
 
static double QQNaN [get]
 
static double QSNaN [get]
 
static bool QSharedBuild [get]
 
static string QVersion [get]
 
static int Qrand [get]
 
- Properties inherited from QtGui.IQPaintDevice
System.Int32 ColorCount [get]
 
 
System.Int32 Depth [get]
 
 
System.Int32 DevType [get]
 
System.IntPtr GetDC [get]
 
System.Int32 Height [get]
 
 
System.Int32 HeightMM [get]
 
 
System.Int32 LogicalDpiX [get]
 
 
System.Int32 LogicalDpiY [get]
 
 
System.Int32 NumColors [get]
 
 
QPaintEngine PaintEngine [get]
 
 
System.Boolean PaintingActive [get]
 
 
System.Int32 PhysicalDpiX [get]
 
 
System.Int32 PhysicalDpiY [get]
 
 
System.Int32 Width [get]
 
 
System.Int32 WidthMM [get]
 
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

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.

Member Enumeration Documentation

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.

Enumerator:
AcceptRole 

Clicking the button causes the dialog to be accepted (e.g. OK).

ActionRole 

Clicking the button causes changes to the elements within the dialog.

ApplyRole 

The button applies current changes.

DestructiveRole 

Clicking the button causes a destructive change (e.g. for Discarding Changes) and closes the dialog.

HelpRole 

The button can be clicked to request help.

InvalidRole 

The button is invalid.

NRoles 
NoRole 

The button is a "No"-like button.

RejectRole 

Clicking the button causes the dialog to be rejected (e.g. Cancel).

ResetRole 

The button resets the dialog's fields to default values.

YesRole 

The button is a "Yes"-like button.

This enum has the following values:

Enumerator:
Critical 

An icon indicating that the message represents a critical problem.

Information 

An icon indicating that the message is nothing out of the ordinary.

NoIcon 

The message box does not have any icon.

Question 

An icon indicating that the message is asking a question.

Warning 

An icon indicating that the message is a warning, but can be dealt with.

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.

Constructor & Destructor Documentation

QtGui.QMessageBox.QMessageBox ( System.Type  dummy)
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:

QMessageBox::NoIcon

QMessageBox::Question

QMessageBox::Information

QMessageBox::Warning

QMessageBox::Critical

Each button, button0, button1 and button2, can have one of the following values:

QMessageBox::NoButton

QMessageBox::Ok

QMessageBox::Cancel

QMessageBox::Yes

QMessageBox::No

QMessageBox::Abort

QMessageBox::Retry

QMessageBox::Ignore

QMessageBox::YesAll

QMessageBox::NoAll

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::Question,

QMessageBox::Yes | QMessageBox::Default,

QMessageBox::No | QMessageBox::Escape,

QMessageBox::NoButton);

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().

Member Function Documentation

static void QtGui.QMessageBox.About ( QWidget  parent,
string  title,
string  text 
)
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 void QtGui.QMessageBox.AboutQt ( QWidget  parent,
string  title = "" 
)
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().

override void QtGui.QMessageBox.CreateProxy ( )
virtual

Reimplemented from QtGui.QDialog.

static QMessageBox.StandardButton QtGui.QMessageBox.Critical ( QWidget  parent,
string  title,
string  text,
QMessageBox.StandardButton  buttons = QMessageBox.StandardButton.Ok,
QMessageBox.StandardButton  defaultButton = QMessageBox.StandardButton.NoButton 
)
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 int QtGui.QMessageBox.Critical ( QWidget  parent,
string  title,
string  text,
int  button0,
int  button1,
int  button2 = 0 
)
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:

QMessageBox::NoButton

QMessageBox::Ok

QMessageBox::Cancel

QMessageBox::Yes

QMessageBox::No

QMessageBox::Abort

QMessageBox::Retry

QMessageBox::Ignore

QMessageBox::YesAll

QMessageBox::NoAll

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 int QtGui.QMessageBox.Critical ( QWidget  parent,
string  title,
string  text,
string  button0Text,
string  button1Text = "",
string  button2Text = "",
int  defaultButtonNumber = 0,
int  escapeButtonNumber = -1 
)
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 QMessageBox.StandardButton QtGui.QMessageBox.Information ( QWidget  parent,
string  title,
string  text,
QMessageBox.StandardButton  buttons = QMessageBox.StandardButton.Ok,
QMessageBox.StandardButton  defaultButton = QMessageBox.StandardButton.NoButton 
)
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 int QtGui.QMessageBox.Information ( QWidget  parent,
string  title,
string  text,
int  button0,
int  button1 = 0,
int  button2 = 0 
)
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:

QMessageBox::NoButton

QMessageBox::Ok

QMessageBox::Cancel

QMessageBox::Yes

QMessageBox::No

QMessageBox::Abort

QMessageBox::Retry

QMessageBox::Ignore

QMessageBox::YesAll

QMessageBox::NoAll

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 int QtGui.QMessageBox.Information ( QWidget  parent,
string  title,
string  text,
string  button0Text,
string  button1Text = "",
string  button2Text = "",
int  defaultButtonNumber = 0,
int  escapeButtonNumber = -1 
)
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().

new void QtGui.QMessageBox.OnButtonClicked ( QAbstractButton  button)
protected

This signal is emitted whenever a button is clicked inside the QMessageBox. The button that was clicked in returned in button.

override void QtGui.QMessageBox.OnChangeEvent ( QEvent event)
protectedvirtual

Reimplemented from QWidget::changeEvent().

Reimplemented from QtGui.QWidget.

override void QtGui.QMessageBox.OnCloseEvent ( QCloseEvent event)
protectedvirtual

Reimplemented from QWidget::closeEvent().

Reimplemented from QtGui.QWidget.

override bool QtGui.QMessageBox.OnEvent ( QEvent  e)
virtual

Reimplemented from QObject::event().

Reimplemented from QtCore.QObject.

override void QtGui.QMessageBox.OnKeyPressEvent ( QKeyEvent event)
protectedvirtual

Reimplemented from QWidget::keyPressEvent().

Reimplemented from QtGui.QWidget.

override void QtGui.QMessageBox.OnResizeEvent ( QResizeEvent event)
protectedvirtual

Reimplemented from QWidget::resizeEvent().

Reimplemented from QtGui.QDialog.

override void QtGui.QMessageBox.OnShowEvent ( QShowEvent event)
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 QMessageBox.StandardButton QtGui.QMessageBox.Question ( QWidget  parent,
string  title,
string  text,
QMessageBox.StandardButton  buttons = QMessageBox.StandardButton.Ok,
QMessageBox.StandardButton  defaultButton = QMessageBox.StandardButton.NoButton 
)
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 int QtGui.QMessageBox.Question ( QWidget  parent,
string  title,
string  text,
int  button0,
int  button1 = 0,
int  button2 = 0 
)
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:

QMessageBox::NoButton

QMessageBox::Ok

QMessageBox::Cancel

QMessageBox::Yes

QMessageBox::No

QMessageBox::Abort

QMessageBox::Retry

QMessageBox::Ignore

QMessageBox::YesAll

QMessageBox::NoAll

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 int QtGui.QMessageBox.Question ( QWidget  parent,
string  title,
string  text,
string  button0Text,
string  button1Text = "",
string  button2Text = "",
int  defaultButtonNumber = 0,
int  escapeButtonNumber = -1 
)
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 QPixmap QtGui.QMessageBox.StandardIcon ( QMessageBox.Icon  icon)
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 string QtGui.QMessageBox.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QMessageBox.Tr ( string  s,
string  c,
int  n 
)
static
static string QtGui.QMessageBox.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QMessageBox.TrUtf8 ( string  s,
string  c,
int  n 
)
static
static QMessageBox.StandardButton QtGui.QMessageBox.Warning ( QWidget  parent,
string  title,
string  text,
QMessageBox.StandardButton  buttons = QMessageBox.StandardButton.Ok,
QMessageBox.StandardButton  defaultButton = QMessageBox.StandardButton.NoButton 
)
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 int QtGui.QMessageBox.Warning ( QWidget  parent,
string  title,
string  text,
int  button0,
int  button1,
int  button2 = 0 
)
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:

QMessageBox::NoButton

QMessageBox::Ok

QMessageBox::Cancel

QMessageBox::Yes

QMessageBox::No

QMessageBox::Abort

QMessageBox::Retry

QMessageBox::Ignore

QMessageBox::YesAll

QMessageBox::NoAll

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 int QtGui.QMessageBox.Warning ( QWidget  parent,
string  title,
string  text,
string  button0Text,
string  button1Text = "",
string  button2Text = "",
int  defaultButtonNumber = 0,
int  escapeButtonNumber = -1 
)
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().

Property Documentation

Slot<QAbstractButton> QtGui.QMessageBox.ButtonClicked
addremove

This signal is emitted whenever a button is clicked inside the QMessageBox. The button that was clicked in returned in button.

System.Collections.Generic.List<QAbstractButton> QtGui.QMessageBox.Buttons
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().

QAbstractButton QtGui.QMessageBox.ClickedButton
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().

QPushButton QtGui.QMessageBox.DefaultButton
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.

new string QtGui.QMessageBox.DetailedText
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.

new IQMessageBoxSignals QtGui.QMessageBox.Emit
getprotected
QAbstractButton QtGui.QMessageBox.EscapeButton
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.

new Icon QtGui.QMessageBox.icon
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

QMessageBox::Question

QMessageBox::Information

QMessageBox::Warning

QMessageBox::Critical

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.

new QPixmap QtGui.QMessageBox.IconPixmap
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.

new string QtGui.QMessageBox.InformativeText
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.

new QMessageBox.StandardButton QtGui.QMessageBox.StandardButtons
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.

new QMetaObject QtGui.QMessageBox.StaticMetaObject
staticget
new string QtGui.QMessageBox.Text
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.

new Qt.TextFormat QtGui.QMessageBox.TextFormat
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.