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

The QMainWindow class provides a main application window. More...

Inheritance diagram for QtGui.QMainWindow:
Collaboration diagram for QtGui.QMainWindow:

Public Types

enum  DockOption {
  AllowNestedDocks = 2, AllowTabbedDocks = 4, AnimatedDocks = 1, ForceTabbedDocks = 8,
  VerticalTabs = 16
}
  More...
 
- Public Types inherited from QtGui.QWidget
enum  RenderFlag { DrawChildren = 2, DrawWindowBackground = 1, IgnoreMask = 4 }
  More...
 

Public Member Functions

 QMainWindow (QWidget parent=null, Qt.WindowType flags=0)
  More...
 
override void CreateProxy ()
 
new void AddDockWidget (Qt.DockWidgetArea area, QDockWidget dockwidget)
  More...
 
new void AddDockWidget (Qt.DockWidgetArea area, QDockWidget dockwidget, Qt.Orientation orientation)
  More...
 
new void AddToolBar (QToolBar toolbar)
  More...
 
new QToolBar AddToolBar (string title)
  More...
 
new void AddToolBar (Qt.ToolBarArea area, QToolBar toolbar)
  More...
 
new void AddToolBarBreak (Qt.ToolBarArea area=Qt.ToolBarArea.TopToolBarArea)
  More...
 
new Qt.DockWidgetArea Corner (Qt.Corner corner)
  More...
 
virtual QMenu CreatePopupMenu ()
  More...
 
new Qt.DockWidgetArea DockWidgetArea (QDockWidget dockwidget)
  More...
 
override bool OnEvent (QEvent @event)
  More...
 
new void InsertToolBar (QToolBar before, QToolBar toolbar)
  More...
 
new void InsertToolBarBreak (QToolBar before)
  More...
 
new bool IsSeparator (QPoint pos)
 
new void RemoveDockWidget (QDockWidget dockwidget)
  More...
 
new void RemoveToolBar (QToolBar toolbar)
  More...
 
new void RemoveToolBarBreak (QToolBar before)
  More...
 
new bool RestoreDockWidget (QDockWidget dockwidget)
  More...
 
new bool RestoreState (QByteArray state, int version=0)
  More...
 
new QByteArray SaveState (int version=0)
  More...
 
new void SetCorner (Qt.Corner corner, Qt.DockWidgetArea area)
  More...
 
new void SetTabPosition (Qt.DockWidgetArea areas, QTabWidget.TabPosition tabPosition)
  More...
 
new void SplitDockWidget (QDockWidget after, QDockWidget dockwidget, Qt.Orientation orientation)
  More...
 
new QTabWidget.TabPosition TabPosition (Qt.DockWidgetArea area)
  More...
 
new
System.Collections.Generic.List
< QDockWidget
TabifiedDockWidgets (QDockWidget dockwidget)
  More...
 
new void TabifyDockWidget (QDockWidget first, QDockWidget second)
  More...
 
new Qt.ToolBarArea ToolBarArea (QToolBar toolbar)
  More...
 
new bool ToolBarBreak (QToolBar toolbar)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QWidget
 QWidget (QWidget parent=null, Qt.WindowType f=0)
  More...
 
override void CreateProxy ()
 
new void ActivateWindow ()
  More...
 
new void AddAction (QAction action)
  More...
 
new void AddActions (System.Collections.Generic.List< QAction > actions)
  More...
 
new void AdjustSize ()
  More...
 
new QWidget ChildAt (QPoint p)
  More...
 
new QWidget ChildAt (int x, int y)
  More...
 
new void ClearFocus ()
  More...
 
new void ClearMask ()
  More...
 
new bool Close ()
  More...
 
new void CreateWinId ()
 
new void EnsurePolished ()
  More...
 
override bool OnEvent (QEvent @event)
  More...
 
new QWidget FocusWidget ()
  More...
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
  More...
 
virtual System.IntPtr GetDC ()
  More...
 
new void GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0)
  More...
 
new void GrabKeyboard ()
  More...
 
new void GrabMouse ()
  More...
 
new void GrabMouse (QCursor cursor)
  More...
 
new int GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut)
  More...
 
virtual int HeightForWidth (int w)
  More...
 
new void Hide ()
  More...
 
virtual object InputMethodQuery (Qt.InputMethodQuery query)
  More...
 
new void InsertAction (QAction before, QAction action)
  More...
 
new void InsertActions (QAction before, System.Collections.Generic.List< QAction > actions)
  More...
 
new bool IsAncestorOf (QWidget child)
  More...
 
new bool IsEnabledTo (QWidget ancestor)
  More...
 
new bool IsVisibleTo (QWidget ancestor)
  More...
 
new void Lower ()
  More...
 
new QPoint MapFrom (QWidget parent, QPoint pos)
  More...
 
new QPoint MapFromGlobal (QPoint pos)
  More...
 
new QPoint MapFromParent (QPoint pos)
  More...
 
new QPoint MapTo (QWidget parent, QPoint pos)
  More...
 
new QPoint MapToGlobal (QPoint pos)
  More...
 
new QPoint MapToParent (QPoint pos)
  More...
 
new void Move (int x, int y)
 
new void OverrideWindowFlags (Qt.WindowType type)
  More...
 
new void OverrideWindowState (Qt.WindowState state)
 
new void Raise ()
  More...
 
virtual void ReleaseDC (System.IntPtr hdc)
  More...
 
new void ReleaseKeyboard ()
  More...
 
new void ReleaseMouse ()
  More...
 
new void ReleaseShortcut (int id)
  More...
 
new void RemoveAction (QAction action)
  More...
 
new void Render (IQPaintDevice target)
  More...
 
new void Render (QPainter painter)
  More...
 
new void Render (IQPaintDevice target, QPoint targetOffset)
  More...
 
new void Render (QPainter painter, QPoint targetOffset)
  More...
 
new void Render (IQPaintDevice target, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
  More...
 
new void Render (QPainter painter, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
  More...
 
new void Repaint ()
  More...
 
new void Repaint (QRect rect)
  More...
 
new void Repaint (QRegion rgn)
  More...
 
new void Repaint (int x, int y, int w, int h)
  More...
 
new void Resize (int w, int h)
 
new bool RestoreGeometry (QByteArray geometry)
  More...
 
new QByteArray SaveGeometry ()
  More...
 
new void Scroll (int dx, int dy)
  More...
 
new void Scroll (int dx, int dy, QRect r)
  More...
 
new void SetAttribute (Qt.WidgetAttribute attribute, bool on=true)
  More...
 
new void SetBaseSize (int basew, int baseh)
 
new void SetContentsMargins (int left, int top, int right, int bottom)
  More...
 
new void SetDisabled (bool disable)
  More...
 
new void SetFixedHeight (int h)
  More...
 
new void SetFixedSize (QSize s)
  More...
 
new void SetFixedSize (int w, int h)
  More...
 
new void SetFixedWidth (int w)
  More...
 
new void SetFocus ()
  More...
 
new void SetFocus (Qt.FocusReason reason)
  More...
 
new void SetGeometry (int x, int y, int w, int h)
 
new void SetHidden (bool hidden)
  More...
 
new void SetMask (QBitmap bitmap)
  More...
 
new void SetMaximumSize (int maxw, int maxh)
 
new void SetMinimumSize (int minw, int minh)
 
new void SetParent (QWidget parent)
  More...
 
new void SetParent (QWidget parent, Qt.WindowType f)
  More...
 
new void SetShortcutAutoRepeat (int id, bool enable=true)
  More...
 
new void SetShortcutEnabled (int id, bool enable=true)
  More...
 
new void SetShown (bool shown)
  More...
 
new void SetSizeIncrement (int w, int h)
 
new void SetSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical)
 
new void Show ()
  More...
 
new void ShowFullScreen ()
  More...
 
new void ShowMaximized ()
  More...
 
new void ShowMinimized ()
  More...
 
new void ShowNormal ()
  More...
 
new void StackUnder (QWidget w)
  More...
 
new bool TestAttribute (Qt.WidgetAttribute attribute)
  More...
 
new void UngrabGesture (Qt.GestureType type)
  More...
 
new void UnsetCursor ()
 
new void UnsetLayoutDirection ()
 
new void UnsetLocale ()
 
new void Update ()
  More...
 
new void Update (QRect rect)
  More...
 
new void Update (QRegion rgn)
  More...
 
new void Update (int x, int y, int w, int h)
  More...
 
new void UpdateGeometry ()
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
  More...
 
new bool BlockSignals (bool b)
  More...
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
new void DeleteLater ()
  More...
 
new bool Disconnect (QObject receiver, string member=null)
  More...
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
  More...
 
new void DumpObjectInfo ()
  More...
 
new void DumpObjectTree ()
  More...
 
virtual bool OnEvent (QEvent e)
  More...
 
virtual bool EventFilter (QObject watched, QEvent @event)
  More...
 
new bool Inherits (string classname)
  More...
 
new void InstallEventFilter (QObject filterObj)
  More...
 
new void KillTimer (int id)
  More...
 
new object Property (string name)
  More...
 
new void RemoveEventFilter (QObject obj)
  More...
 
new bool SetProperty (string name, object value)
  More...
 
new void SetUserData (uint id, QObjectUserData data)
 
new int StartTimer (int interval)
  More...
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- 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)
 

Static Public Member Functions

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)
  More...
 
static void SetTabOrder (QWidget first, QWidget second)
  More...
 
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
  More...
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
  More...
 
static string Tr (string s, string c=null)
  More...
 
static string Tr (string s, string c, int n)
  More...
 
static string TrUtf8 (string s, string c=null)
  More...
 
static string TrUtf8 (string s, string c, int n)
  More...
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Write (QDataStream stream, QPoint point)
  More...
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream stream, QLineF line)
  More...
 
static QDataStream Write (QDataStream stream, QPointF point)
  More...
 
static QDataStream Write (QDataStream @out, QChar chr)
  More...
 
static QDataStream Write (QDataStream @out, QByteArray ba)
  More...
 
static QDataStream Write (QDataStream stream, QEasingCurve easing)
  More...
 
static QDataStream Write (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Write (QDataStream @out, QDateTime dateTime)
  More...
 
static QDataStream Write (QDataStream @out, QUrl url)
  More...
 
static QDataStream Write (QDataStream @out, QTime time)
  More...
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream @out, QBitArray ba)
  More...
 
static QDataStream Write (QDataStream s, QUuid id)
  More...
 
static QDataStream Write (QDataStream stream, QLine line)
  More...
 
static QDataStream Write (QDataStream @out, QDate date)
  More...
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
  More...
 
static QDataStream Write (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Write (QDataStream stream, QSize size)
  More...
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
  More...
 
static QDataStream Read (QDataStream @in, QChar chr)
  More...
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream @in, QDate date)
  More...
 
static QDataStream Read (QDataStream @in, QUrl url)
  More...
 
static QDataStream Read (QDataStream s, QUuid id)
  More...
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream stream, QLineF line)
  More...
 
static QDataStream Read (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Read (QDataStream stream, QPointF point)
  More...
 
static QDataStream Read (QDataStream stream, QLine line)
  More...
 
static QDataStream Read (QDataStream @in, QBitArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSize size)
  More...
 
static QDataStream Read (QDataStream @in, QDateTime dateTime)
  More...
 
static QDataStream Read (QDataStream @in, QTime time)
  More...
 
static QDataStream Read (QDataStream stream, QPoint point)
  More...
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
  More...
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream @in, QByteArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
  More...
 
static double QAcos (double v)
  More...
 
static void QAddPostRoutine (System.Action ptr)
  More...
 
static double QAsin (double v)
  More...
 
static double QAtan (double v)
  More...
 
static double QAtan2 (double x, double y)
  More...
 
static void QBadAlloc ()
 
static int QCeil (double v)
  More...
 
static ushort QChecksum (string s, uint len)
  More...
 
static QByteArray QCompress (QByteArray data, int compressionLevel=-1)
  More...
 
static QByteArray QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
  More...
 
static double QCos (double v)
  More...
 
static double QExp (double v)
  More...
 
static double QFabs (double v)
 
static double QFastCos (double x)
 
static double QFastSin (double x)
 
static string QFlagLocation (string method)
 
static int QFloor (double v)
  More...
 
static bool QFuzzyCompare (double p1, double p2)
  More...
 
static bool QFuzzyCompare (float p1, float p2)
  More...
 
static bool QFuzzyIsNull (double d)
 
static bool QFuzzyIsNull (float f)
 
static uint QHash (QBitArray key)
  More...
 
static uint QHash (QChar key)
  More...
 
static uint QHash (QStringRef key)
 
static uint QHash (QUrl url)
  More...
 
static uint QHash (QPersistentModelIndex index)
 
static uint QHash (QByteArray key)
  More...
 
static uint QHash (QModelIndex index)
 
static uint QHash (uint key)
  More...
 
static uint QHash (char key)
  More...
 
static uint QHash (byte key)
  More...
 
static uint QHash (short key)
  More...
 
static uint QHash (NativeLong key)
  More...
 
static uint QHash (ushort key)
  More...
 
static uint QHash (long key)
  More...
 
static uint QHash (ulong key)
  More...
 
static uint QHash (int key)
  More...
 
static uint QHash (string key)
  More...
 
static uint QHash (NativeULong key)
  More...
 
static Qt.ActionQtMsgTypeString QInstallMsgHandler (Qt.ActionQtMsgTypeString handler)
  More...
 
static int QIntCast (float f)
 
static int QIntCast (double f)
 
static bool QIsFinite (double d)
 
static bool QIsFinite (float f)
 
static bool QIsInf (float f)
 
static bool QIsInf (double d)
 
static bool QIsNaN (float f)
 
static bool QIsNaN (double d)
 
static bool QIsNull (float f)
 
static bool QIsNull (double d)
 
static double QLn (double v)
  More...
 
static double QPow (double x, double y)
  More...
 
static void QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
  More...
 
static void QRemovePostRoutine (System.Action arg1)
 
static int QRound (double d)
  More...
 
static long QRound64 (double d)
  More...
 
static double QSin (double v)
  More...
 
static double QSqrt (double v)
  More...
 
static bool QStringComparisonHelper (QStringRef s1, string s2)
 
static double QTan (double v)
  More...
 
static QByteArray QUncompress (QByteArray data)
  More...
 
static QByteArray QUncompress (Pointer< byte > data, int nbytes)
  More...
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
  More...
 
static bool Qputenv (string varName, QByteArray value)
  More...
 
static void Qsrand (uint seed)
  More...
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
  More...
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
  More...
 
static Pointer< sbyte > Qstrdup (string src)
  More...
 
static int Qstricmp (string str1, string str2)
  More...
 
static uint Qstrlen (string str)
  More...
 
static int Qstrncmp (string str1, string str2, uint len)
  More...
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
  More...
 
static int Qstrnicmp (string str1, string str2, uint len)
  More...
 
static uint Qstrnlen (string str, uint maxlen)
  More...
 

Protected Member Functions

 QMainWindow (System.Type dummy)
 
override void OnContextMenuEvent (QContextMenuEvent @event)
  More...
 
new void OnIconSizeChanged (QSize iconSize)
  More...
 
new void OnToolButtonStyleChanged (Qt.ToolButtonStyle toolButtonStyle)
  More...
 
- Protected Member Functions inherited from QtGui.QWidget
 QWidget (System.Type dummy)
 
virtual void OnActionEvent (QActionEvent @event)
  More...
 
virtual void OnChangeEvent (QEvent @event)
  More...
 
virtual void OnCloseEvent (QCloseEvent @event)
  More...
 
new void Create ()
  More...
 
new void Create (NativeULong window, bool initializeWindow=true, bool destroyOldWindow=true)
  More...
 
new void OnCustomContextMenuRequested (QPoint pos)
  More...
 
new void Destroy (bool destroyWindow=true, bool destroySubWindows=true)
  More...
 
virtual void OnDragEnterEvent (QDragEnterEvent @event)
  More...
 
virtual void OnDragLeaveEvent (QDragLeaveEvent @event)
  More...
 
virtual void OnDragMoveEvent (QDragMoveEvent @event)
  More...
 
virtual void OnDropEvent (QDropEvent @event)
  More...
 
virtual void EnabledChange (bool arg1)
 
virtual void OnEnterEvent (QEvent @event)
  More...
 
virtual void OnFocusInEvent (QFocusEvent @event)
  More...
 
new bool FocusNextChild ()
  More...
 
virtual bool FocusNextPrevChild (bool next)
  More...
 
virtual void OnFocusOutEvent (QFocusEvent @event)
  More...
 
new bool FocusPreviousChild ()
  More...
 
virtual void FontChange (QFont arg1)
 
virtual void OnHideEvent (QHideEvent @event)
  More...
 
virtual void OnInputMethodEvent (QInputMethodEvent @event)
  More...
 
virtual void OnKeyPressEvent (QKeyEvent @event)
  More...
 
virtual void OnKeyReleaseEvent (QKeyEvent @event)
  More...
 
virtual void LanguageChange ()
  More...
 
virtual void OnLeaveEvent (QEvent @event)
  More...
 
virtual int Metric (QPaintDevice.PaintDeviceMetric m)
  More...
 
virtual void OnMouseDoubleClickEvent (QMouseEvent @event)
  More...
 
virtual void OnMouseMoveEvent (QMouseEvent @event)
  More...
 
virtual void OnMousePressEvent (QMouseEvent @event)
  More...
 
virtual void OnMouseReleaseEvent (QMouseEvent @event)
  More...
 
virtual void OnMoveEvent (QMoveEvent @event)
  More...
 
virtual void OnPaintEvent (QPaintEvent @event)
  More...
 
virtual void PaletteChange (QPalette arg1)
 
new void ResetInputContext ()
  More...
 
virtual void OnResizeEvent (QResizeEvent @event)
  More...
 
virtual void OnShowEvent (QShowEvent @event)
  More...
 
virtual void StyleChange (QStyle arg1)
 
virtual void OnTabletEvent (QTabletEvent @event)
  More...
 
new void UpdateMicroFocus ()
  More...
 
virtual void OnWheelEvent (QWheelEvent @event)
  More...
 
virtual void WindowActivationChange (bool arg1)
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent @event)
  More...
 
virtual void ConnectNotify (string signal)
  More...
 
virtual void OnCustomEvent (QEvent @event)
  More...
 
new void OnDestroyed (QObject obj=null)
  More...
 
virtual void DisconnectNotify (string signal)
  More...
 
new int Receivers (string signal)
  More...
 
virtual void OnTimerEvent (QTimerEvent @event)
  More...
 

Properties

Slot< QSizeIconSizeChanged
  More...
 
Slot< Qt.ToolButtonStyleToolButtonStyleChanged
  More...
 
QWidget CentralWidget [get, set]
  More...
 
QMenuBar MenuBar [get, set]
  More...
 
QWidget MenuWidget [get, set]
  More...
 
QStatusBar StatusBar [get, set]
  More...
 
new QSize IconSize [get, set]
  More...
 
new Qt.ToolButtonStyle ToolButtonStyle [get, set]
  More...
 
new bool Animated [get, set]
  More...
 
new bool DocumentMode [get, set]
  More...
 
new QTabWidget.TabShape TabShape [get, set]
  More...
 
new bool DockNestingEnabled [get, set]
  More...
 
new QMainWindow.DockOption DockOptions [get, set]
  More...
 
new bool UnifiedTitleAndToolBarOnMac [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQMainWindowSignals Emit [get]
 
- Properties inherited from QtGui.QWidget
virtual EventHandler
< QEventArgs< QActionEvent > > 
ActionEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
ChangeEvent
  More...
 
virtual EventHandler
< QEventArgs< QCloseEvent > > 
CloseEvent
  More...
 
virtual EventHandler
< QEventArgs
< QContextMenuEvent > > 
ContextMenuEvent
  More...
 
virtual EventHandler
< QEventArgs< QDragEnterEvent > > 
DragEnterEvent
  More...
 
virtual EventHandler
< QEventArgs< QDragLeaveEvent > > 
DragLeaveEvent
  More...
 
virtual EventHandler
< QEventArgs< QDragMoveEvent > > 
DragMoveEvent
  More...
 
virtual EventHandler
< QEventArgs< QDropEvent > > 
DropEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
EnterEvent
  More...
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusInEvent
  More...
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusOutEvent
  More...
 
virtual EventHandler
< QEventArgs< QHideEvent > > 
HideEvent
  More...
 
virtual EventHandler
< QEventArgs
< QInputMethodEvent > > 
InputMethodEvent
  More...
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyPressEvent
  More...
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyReleaseEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
LeaveEvent
  More...
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseDoubleClickEvent
  More...
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseMoveEvent
  More...
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MousePressEvent
  More...
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseReleaseEvent
  More...
 
virtual EventHandler
< QEventArgs< QMoveEvent > > 
MoveEvent
  More...
 
virtual EventHandler
< QEventArgs< QPaintEvent > > 
PaintEvent
  More...
 
virtual EventHandler
< QEventArgs< QResizeEvent > > 
ResizeEvent
  More...
 
virtual EventHandler
< QEventArgs< QShowEvent > > 
ShowEvent
  More...
 
virtual EventHandler
< QEventArgs< QTabletEvent > > 
TabletEvent
  More...
 
virtual EventHandler
< QEventArgs< QWheelEvent > > 
WheelEvent
  More...
 
Slot< QPointCustomContextMenuRequested
  More...
 
QPalette.ColorRole BackgroundRole [get, set]
  More...
 
QMargins ContentsMargins [get, set]
  More...
 
QWidget FocusProxy [get, set]
  More...
 
QPalette.ColorRole ForegroundRole [get, set]
  More...
 
QGraphicsEffect GraphicsEffect [get, set]
  More...
 
QInputContext InputContext [get, set]
  More...
 
QLayout Layout [get, set]
  More...
 
QRegion Mask [get, set]
  More...
 
QStyle Style [get, set]
  More...
 
Qt.WindowType WindowFlags [get, set]
 
string WindowRole [get, set]
  More...
 
Qt.WindowState WindowState [get, set]
  More...
 
virtual int DevType [get]
 
virtual QPaintEngine PaintEngine [get]
  More...
 
int ColorCount [get]
  More...
 
int Depth [get]
  More...
 
int HeightMM [get]
  More...
 
int LogicalDpiX [get]
  More...
 
int LogicalDpiY [get]
  More...
 
int NumColors [get]
  More...
 
bool PaintingActive [get]
  More...
 
int PhysicalDpiX [get]
  More...
 
int PhysicalDpiY [get]
  More...
 
int WidthMM [get]
  More...
 
System.Collections.Generic.List
< QAction
Actions [get]
  More...
 
QRect ContentsRect [get]
  More...
 
NativeULong EffectiveWinId [get]
  More...
 
QFontInfo FontInfo [get]
  More...
 
QFontMetrics FontMetrics [get]
  More...
 
QGraphicsProxyWidget GraphicsProxyWidget [get]
  More...
 
NativeULong InternalWinId [get]
 
bool IsEnabledToTLW [get]
  More...
 
bool IsHidden [get]
  More...
 
bool IsLeftToRight [get]
 
bool IsRightToLeft [get]
 
bool IsTopLevel [get]
  More...
 
bool IsWindow [get]
  More...
 
static QWidget KeyboardGrabber [get]
  More...
 
static QWidget MouseGrabber [get]
  More...
 
QWidget NativeParentWidget [get]
  More...
 
QWidget NextInFocusChain [get]
  More...
 
QWidget ParentWidget [get]
  More...
 
QWidget PreviousInFocusChain [get]
  More...
 
QWidget TopLevelWidget [get]
  More...
 
bool UnderMouse [get]
  More...
 
QRegion VisibleRegion [get]
  More...
 
NativeULong WinId [get]
  More...
 
QWidget Window [get]
  More...
 
Qt.WindowType WindowType [get]
  More...
 
new bool Modal [get]
  More...
 
new Qt.WindowModality WindowModality [get, set]
  More...
 
new bool Enabled [get, set]
  More...
 
new QRect Geometry [get, set]
  More...
 
new QRect FrameGeometry [get]
  More...
 
new QRect NormalGeometry [get]
  More...
 
new int X [get]
  More...
 
new int Y [get]
  More...
 
new QPoint Pos [get, set]
  More...
 
new QSize FrameSize [get]
  More...
 
new QSize Size [get, set]
  More...
 
new int Width [get]
  More...
 
new int Height [get]
  More...
 
new QRect Rect [get]
  More...
 
new QRect ChildrenRect [get]
  More...
 
new QRegion ChildrenRegion [get]
  More...
 
new QSizePolicy SizePolicy [get, set]
  More...
 
new QSize MinimumSize [get, set]
  More...
 
new QSize MaximumSize [get, set]
  More...
 
new int MinimumWidth [get, set]
  More...
 
new int MinimumHeight [get, set]
  More...
 
new int MaximumWidth [get, set]
  More...
 
new int MaximumHeight [get, set]
  More...
 
new QSize SizeIncrement [get, set]
  More...
 
new QSize BaseSize [get, set]
  More...
 
new QPalette Palette [get, set]
  More...
 
new QFont Font [get, set]
  More...
 
new QCursor Cursor [get, set]
  More...
 
new bool MouseTracking [get, set]
  More...
 
new bool IsActiveWindow [get]
  More...
 
new Qt.FocusPolicy FocusPolicy [get, set]
  More...
 
new bool Focus [get]
  More...
 
new Qt.ContextMenuPolicy ContextMenuPolicy [get, set]
  More...
 
new bool UpdatesEnabled [get, set]
  More...
 
virtual new bool Visible [get, set]
  More...
 
new bool Minimized [get]
  More...
 
new bool Maximized [get]
  More...
 
new bool FullScreen [get]
  More...
 
virtual new QSize SizeHint [get]
  More...
 
virtual new QSize MinimumSizeHint [get]
  More...
 
new bool AcceptDrops [get, set]
  More...
 
new string WindowTitle [get, set]
  More...
 
new QIcon WindowIcon [get, set]
  More...
 
new string WindowIconText [get, set]
  More...
 
new double WindowOpacity [get, set]
  More...
 
new bool WindowModified [get, set]
  More...
 
new string ToolTip [get, set]
  More...
 
new string StatusTip [get, set]
  More...
 
new string WhatsThis [get, set]
  More...
 
new string AccessibleName [get, set]
  More...
 
new string AccessibleDescription [get, set]
  More...
 
new Qt.LayoutDirection LayoutDirection [get, set]
  More...
 
new bool AutoFillBackground [get, set]
  More...
 
new string StyleSheet [get, set]
  More...
 
new QLocale Locale [get, set]
  More...
 
new string WindowFilePath [get, set]
  More...
 
new Qt.InputMethodHint InputMethodHints [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new ushort Painters [get, set]
 
new IQWidgetSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
  More...
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
  More...
 
Slot< QObjectDestroyedObj
  More...
 
Slot Destroyed
  More...
 
QObject Parent [get, set]
  More...
 
System.Collections.Generic.List
< QObject
Children [get]
  More...
 
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames [get]
  More...
 
bool IsWidgetType [get]
  More...
 
static uint RegisterUserData [get]
 
QObject Sender [get]
  More...
 
int SenderSignalIndex [get]
  More...
 
bool SignalsBlocked [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
  More...
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 
- 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]
  More...
 
static int Qrand [get]
  More...
 
- Properties inherited from QtGui.IQPaintDevice
System.Int32 ColorCount [get]
  More...
 
System.Int32 Depth [get]
  More...
 
System.Int32 DevType [get]
 
System.Int32 Height [get]
  More...
 
System.Int32 HeightMM [get]
  More...
 
System.Int32 LogicalDpiX [get]
  More...
 
System.Int32 LogicalDpiY [get]
  More...
 
System.Int32 NumColors [get]
  More...
 
QPaintEngine PaintEngine [get]
  More...
 
System.Boolean PaintingActive [get]
  More...
 
System.Int32 PhysicalDpiX [get]
  More...
 
System.Int32 PhysicalDpiY [get]
  More...
 
System.Int32 Width [get]
  More...
 
System.Int32 WidthMM [get]
  More...
 

Additional Inherited Members

- Static Public Attributes inherited from QtCore.Qt
</para > *< para > Creating QM
files suitable for use with
this[SmokeMethod("qtTrId(const
char*, int)")] static strin 
QtTrId )(string id, int n=-1)
 
- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QMainWindow class provides a main application window.

Qt Main Window Framework

A main window provides a framework for building an application's user interface. Qt has QMainWindow and its related classes for main window management. QMainWindow has its own layout to which you can add QToolBars, QDockWidgets, a QMenuBar, and a QStatusBar. The layout has a center area that can be occupied by any kind of widget. You can see an image of the layout below.

Note: Creating a main window without a central widget is not supported. You must have a central widget even if it is just a placeholder.

Creating Main Window Components

A central widget will typically be a standard Qt widget such as a QTextEdit or a QGraphicsView. Custom widgets can also be used for advanced applications. You set the central widget with setCentralWidget().

Main windows have either a single (SDI) or multiple (MDI) document interface. You create MDI applications in Qt by using a QMdiArea as the central widget.

We will now examine each of the other widgets that can be added to a main window. We give examples on how to create and add them.

Creating Menus

Qt implements menus in QMenu and QMainWindow keeps them in a QMenuBar. QActions are added to the menus, which display them as menu items.

You can add new menus to the main window's menu bar by calling menuBar(), which returns the QMenuBar for the window, and then add a menu with QMenuBar::addMenu().

QMainWindow comes with a default menu bar, but you can also set one yourself with setMenuBar(). If you wish to implement a custom menu bar (i.e., not use the QMenuBar widget), you can set it with setMenuWidget().

An example of how to create menus follows:

void MainWindow::createMenus()

{

fileMenu = menuBar()->addMenu(tr("&File"));

fileMenu->addAction(newAct);

fileMenu->addAction(openAct);

fileMenu->addAction(saveAct);

The createPopupMenu() function creates popup menus when the main window receives context menu events. The default implementation generates a menu with the checkable actions from the dock widgets and toolbars. You can reimplement createPopupMenu() for a custom menu.

Creating Toolbars

Toolbars are implemented in the QToolBar class. You add a toolbar to a main window with addToolBar().

You control the initial position of toolbars by assigning them to a specific Qt::ToolBarArea. You can split an area by inserting a toolbar break - think of this as a line break in text editing - with addToolBarBreak() or insertToolBarBreak(). You can also restrict placement by the user with QToolBar::setAllowedAreas() and QToolBar::setMovable().

The size of toolbar icons can be retrieved with iconSize(). The sizes are platform dependent; you can set a fixed size with setIconSize(). You can alter the appearance of all tool buttons in the toolbars with setToolButtonStyle().

An example of toolbar creation follows:

void MainWindow::createToolBars()

{

fileToolBar = addToolBar(tr("File"));

fileToolBar->addAction(newAct);

Creating Dock Widgets

Dock widgets are implemented in the QDockWidget class. A dock widget is a window that can be docked into the main window. You add dock widgets to a main window with addDockWidget().

There are four dock widget areas as given by the Qt::DockWidgetArea enum: left, right, top, and bottom. You can specify which dock widget area that should occupy the corners where the areas overlap with setCorner(). By default each area can only contain one row (vertical or horizontal) of dock widgets, but if you enable nesting with setDockNestingEnabled(), dock widgets can be added in either direction.

Two dock widgets may also be stacked on top of each other. A QTabBar is then used to select which of the widgets that should be displayed.

We give an example of how to create and add dock widgets to a main window:

QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this);

dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea |

Qt::RightDockWidgetArea);

dockWidget->setWidget(dockWidgetContents);

addDockWidget(Qt::LeftDockWidgetArea, dockWidget);

The Status Bar

You can set a status bar with setStatusBar(), but one is created the first time statusBar() (which returns the main window's status bar) is called. See QStatusBar for information on how to use it.

Storing State

QMainWindow can store the state of its layout with saveState(); it can later be retrieved with restoreState(). It is the position and size (relative to the size of the main window) of the toolbars and dock widgets that are stored.

See also QMenuBar, QToolBar, QStatusBar, QDockWidget, Application Example, Dock Widgets Example, MDI Example, SDI Example, and Menus Example.

Member Enumeration Documentation

This enum contains flags that specify the docking behavior of QMainWindow.

These options only control how dock widgets may be dropped in a QMainWindow. They do not re-arrange the dock widgets to conform with the specified options. For this reason they should be set before any dock widgets are added to the main window. Exceptions to this are the AnimatedDocks and VerticalTabs options, which may be set at any time.

This enum was introduced or modified in Qt 4.3.

Enumerator
AllowNestedDocks 

Identical to the dockNestingEnabled property.

AllowTabbedDocks 

The user can drop one dock widget "on top" of another. The two widgets are stacked and a tab bar appears for selecting which one is visible.

AnimatedDocks 

Identical to the animated property.

ForceTabbedDocks 

Each dock area contains a single stack of tabbed dock widgets. In other words, dock widgets cannot be placed next to each other in a dock area. If this option is set, AllowNestedDocks has no effect.

VerticalTabs 

The two vertical dock areas on the sides of the main window show their tabs vertically. If this option is not set, all dock areas show their tabs at the bottom. Implies AllowTabbedDocks. See also setTabPosition().

Constructor & Destructor Documentation

QtGui.QMainWindow.QMainWindow ( System.Type  dummy)
protected
QtGui.QMainWindow.QMainWindow ( QWidget  parent = null,
Qt.WindowType  flags = 0 
)

Constructs a QMainWindow with the given parent and the specified widget flags.

QMainWindow sets the Qt::Window flag itself, and will hence always be created as a top-level widget.

Here is the call graph for this function:

Member Function Documentation

new void QtGui.QMainWindow.AddDockWidget ( Qt.DockWidgetArea  area,
QDockWidget  dockwidget 
)

Adds the given dockwidget to the specified area.

new void QtGui.QMainWindow.AddDockWidget ( Qt.DockWidgetArea  area,
QDockWidget  dockwidget,
Qt.Orientation  orientation 
)

Adds dockwidget into the given area in the direction specified by the orientation.

new void QtGui.QMainWindow.AddToolBar ( QToolBar  toolbar)

This is an overloaded function.

Equivalent of calling addToolBar(Qt::TopToolBarArea, toolbar)

new QToolBar QtGui.QMainWindow.AddToolBar ( string  title)

This is an overloaded function.

Creates a QToolBar object, setting its window title to title, and inserts it into the top toolbar area.

See also setWindowTitle().

new void QtGui.QMainWindow.AddToolBar ( Qt.ToolBarArea  area,
QToolBar  toolbar 
)

Adds the toolbar into the specified area in this main window. The toolbar is placed at the end of the current tool bar block (i.e. line). If the main window already manages toolbar then it will only move the toolbar to area.

See also insertToolBar(), addToolBarBreak(), and insertToolBarBreak().

new void QtGui.QMainWindow.AddToolBarBreak ( Qt.ToolBarArea  area = Qt.ToolBarArea.TopToolBarArea)

Adds a toolbar break to the given area after all the other objects that are present.

new Qt.DockWidgetArea QtGui.QMainWindow.Corner ( Qt.Corner  corner)

Returns the dock widget area that occupies the specified corner.

See also setCorner().

virtual QMenu QtGui.QMainWindow.CreatePopupMenu ( )
virtual

Returns a popup menu containing checkable entries for the toolbars and dock widgets present in the main window. If there are no toolbars and dock widgets present, this function returns a null pointer.

By default, this function is called by the main window when the user activates a context menu, typically by right-clicking on a toolbar or a dock widget.

If you want to create a custom popup menu, reimplement this function and return a newly-created popup menu. Ownership of the popup menu is transferred to the caller.

See also addDockWidget(), addToolBar(), and menuBar().

override void QtGui.QMainWindow.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

Here is the caller graph for this function:

new void QtGui.QMainWindow.Dispose ( )
new Qt.DockWidgetArea QtGui.QMainWindow.DockWidgetArea ( QDockWidget  dockwidget)

Returns the Qt::DockWidgetArea for dockwidget. If dockwidget has not been added to the main window, this function returns Qt::NoDockWidgetArea.

See also addDockWidget(), splitDockWidget(), and Qt::DockWidgetArea.

new void QtGui.QMainWindow.InsertToolBar ( QToolBar  before,
QToolBar  toolbar 
)

Inserts the toolbar into the area occupied by the before toolbar so that it appears before it. For example, in normal left-to-right layout operation, this means that toolbar will appear to the left of the toolbar specified by before in a horizontal toolbar area.

See also insertToolBarBreak(), addToolBar(), and addToolBarBreak().

new void QtGui.QMainWindow.InsertToolBarBreak ( QToolBar  before)

Inserts a toolbar break before the toolbar specified by before.

new bool QtGui.QMainWindow.IsSeparator ( QPoint  pos)
override void QtGui.QMainWindow.OnContextMenuEvent ( QContextMenuEvent event)
protectedvirtual

Reimplemented from QWidget::contextMenuEvent().

Reimplemented from QtGui.QWidget.

override bool QtGui.QMainWindow.OnEvent ( QEvent event)

Reimplemented from QObject::event().

new void QtGui.QMainWindow.OnIconSizeChanged ( QSize  iconSize)
protected

This signal is emitted when the size of the icons used in the window is changed. The new icon size is passed in iconSize.

You can connect this signal to other components to help maintain a consistent appearance for your application.

See also setIconSize().

new void QtGui.QMainWindow.OnToolButtonStyleChanged ( Qt.ToolButtonStyle  toolButtonStyle)
protected

This signal is emitted when the style used for tool buttons in the window is changed. The new style is passed in toolButtonStyle.

You can connect this signal to other components to help maintain a consistent appearance for your application.

See also setToolButtonStyle().

new void QtGui.QMainWindow.RemoveDockWidget ( QDockWidget  dockwidget)

Removes the dockwidget from the main window layout and hides it. Note that the dockwidget is not deleted.

new void QtGui.QMainWindow.RemoveToolBar ( QToolBar  toolbar)

Removes the toolbar from the main window layout and hides it. Note that the toolbar is not deleted.

new void QtGui.QMainWindow.RemoveToolBarBreak ( QToolBar  before)

Removes a toolbar break previously inserted before the toolbar specified by before.

new bool QtGui.QMainWindow.RestoreDockWidget ( QDockWidget  dockwidget)

Restores the state of dockwidget if it is created after the call to restoreState(). Returns true if the state was restored; otherwise returns false.

See also restoreState() and saveState().

new bool QtGui.QMainWindow.RestoreState ( QByteArray  state,
int  version = 0 
)

Restores the state of this mainwindow's toolbars and dockwidgets. The version number is compared with that stored in state. If they do not match, the mainwindow's state is left unchanged, and this function returns false; otherwise, the state is restored, and this function returns true.

To restore geometry saved using QSettings, you can use code like this:

void MainWindow::readSettings()

{

QSettings settings("MyCompany", "MyApp");

restoreGeometry(settings.value("myWidget/geometry").toByteArray());

restoreState(settings.value("myWidget/windowState").toByteArray());

}

See also saveState(), QWidget::saveGeometry(), QWidget::restoreGeometry(), and restoreDockWidget().

new QByteArray QtGui.QMainWindow.SaveState ( int  version = 0)

Saves the current state of this mainwindow's toolbars and dockwidgets. The version number is stored as part of the data.

The objectName property is used to identify each QToolBar and QDockWidget. You should make sure that this property is unique for each QToolBar and QDockWidget you add to the QMainWindow

To restore the saved state, pass the return value and version number to restoreState().

To save the geometry when the window closes, you can implement a close event like this:

void MyMainWindow::closeEvent(QCloseEvent *event)

{

QSettings settings("MyCompany", "MyApp");

settings.setValue("geometry", saveGeometry());

settings.setValue("windowState", saveState());

QMainWindow::closeEvent(event);

}

See also restoreState(), QWidget::saveGeometry(), and QWidget::restoreGeometry().

new void QtGui.QMainWindow.SetCorner ( Qt.Corner  corner,
Qt.DockWidgetArea  area 
)

Sets the given dock widget area to occupy the specified corner.

See also corner().

new void QtGui.QMainWindow.SetTabPosition ( Qt.DockWidgetArea  areas,
QTabWidget.TabPosition  tabPosition 
)

Sets the tab position for the given dock widget areas to the specified tabPosition. By default, all dock areas show their tabs at the bottom.

Note: The VerticalTabs dock option overrides the tab positions set by this method.

This function was introduced in Qt 4.5.

See also tabPosition() and setTabShape().

new void QtGui.QMainWindow.SplitDockWidget ( QDockWidget  after,
QDockWidget  dockwidget,
Qt.Orientation  orientation 
)

Splits the space covered by the first dock widget into two parts, moves the first dock widget into the first part, and moves the second dock widget into the second part.

The orientation specifies how the space is divided: A Qt::Horizontal split places the second dock widget to the right of the first; a Qt::Vertical split places the second dock widget below the first.

Note: if first is currently in a tabbed docked area, second will be added as a new tab, not as a neighbor of first. This is because a single tab can contain only one dock widget.

Note: The Qt::LayoutDirection influences the order of the dock widgets in the two parts of the divided area. When right-to-left layout direction is enabled, the placing of the dock widgets will be reversed.

See also tabifyDockWidget(), addDockWidget(), and removeDockWidget().

new System.Collections.Generic.List<QDockWidget> QtGui.QMainWindow.TabifiedDockWidgets ( QDockWidget  dockwidget)

Returns the dock widgets that are tabified together with dockwidget.

This function was introduced in Qt 4.5.

See also tabifyDockWidget().

new void QtGui.QMainWindow.TabifyDockWidget ( QDockWidget  first,
QDockWidget  second 
)

Moves second dock widget on top of first dock widget, creating a tabbed docked area in the main window.

See also tabifiedDockWidgets().

new QTabWidget.TabPosition QtGui.QMainWindow.TabPosition ( Qt.DockWidgetArea  area)

Returns the tab position for area.

Note: The VerticalTabs dock option overrides the tab positions returned by this function.

This function was introduced in Qt 4.5.

See also setTabPosition() and tabShape().

new Qt.ToolBarArea QtGui.QMainWindow.ToolBarArea ( QToolBar  toolbar)

Returns the Qt::ToolBarArea for toolbar. If toolbar has not been added to the main window, this function returns Qt::NoToolBarArea.

See also addToolBar(), addToolBarBreak(), and Qt::ToolBarArea.

new bool QtGui.QMainWindow.ToolBarBreak ( QToolBar  toolbar)

Returns whether there is a toolbar break before the toolbar.

See also addToolBarBreak() and insertToolBarBreak().

static string QtGui.QMainWindow.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QMainWindow.Tr ( string  s,
string  c,
int  n 
)
static
static string QtGui.QMainWindow.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QMainWindow.TrUtf8 ( string  s,
string  c,
int  n 
)
static

Property Documentation

new bool QtGui.QMainWindow.Animated
getset

This property holds whether manipulating dock widgets and tool bars is animated.

When a dock widget or tool bar is dragged over the main window, the main window adjusts its contents to indicate where the dock widget or tool bar will be docked if it is dropped. Setting this property causes QMainWindow to move its contents in a smooth animation. Clearing this property causes the contents to snap into their new positions.

By default, this property is set. It may be cleared if the main window contains widgets which are slow at resizing or repainting themselves.

Setting this property is identical to setting the AnimatedDocks option using setDockOptions().

This property was introduced in Qt 4.2.

QWidget QtGui.QMainWindow.CentralWidget
getset

Returns the central widget for the main window. This function returns zero if the central widget has not been set.

Sets the given widget to be the main window's central widget.

Note: QMainWindow takes ownership of the widget pointer and deletes it at the appropriate time.

new bool QtGui.QMainWindow.DockNestingEnabled
getset

This property holds whether docks can be nested.

If this property is false, dock areas can only contain a single row (horizontal or vertical) of dock widgets. If this property is true, the area occupied by a dock widget can be split in either direction to contain more dock widgets.

Dock nesting is only necessary in applications that contain a lot of dock widgets. It gives the user greater freedom in organizing their main window. However, dock nesting leads to more complex (and less intuitive) behavior when a dock widget is dragged over the main window, since there are more ways in which a dropped dock widget may be placed in the dock area.

Setting this property is identical to setting the AllowNestedDocks option using setDockOptions().

This property was introduced in Qt 4.2.

new QMainWindow.DockOption QtGui.QMainWindow.DockOptions
getset

This property holds the docking behavior of QMainWindow.

The default value is AnimatedDocks | AllowTabbedDocks.

This property was introduced in Qt 4.3.

new bool QtGui.QMainWindow.DocumentMode
getset

This property holds whether the tab bar for tabbed dockwidgets is set to document mode.

The default is false.

This property was introduced in Qt 4.5.

new IQMainWindowSignals QtGui.QMainWindow.Emit
getprotected
new QSize QtGui.QMainWindow.IconSize
getset

This property holds size of toolbar icons in this mainwindow.

The default is the default tool bar icon size of the GUI style. Note that the icons used must be at least of this size as the icons are only scaled down.

Slot<QSize> QtGui.QMainWindow.IconSizeChanged
addremove

This signal is emitted when the size of the icons used in the window is changed. The new icon size is passed in iconSize.

You can connect this signal to other components to help maintain a consistent appearance for your application.

See also setIconSize().

QMenuBar QtGui.QMainWindow.MenuBar
getset

Returns the menu bar for the main window. This function creates and returns an empty menu bar if the menu bar does not exist.

If you want all windows in a Mac application to share one menu bar, don't use this function to create it, because the menu bar created here will have this QMainWindow as its parent. Instead, you must create a menu bar that does not have a parent, which you can then share among all the Mac windows. Create a parent-less menu bar this way:

QMenuBar *menuBar = new QMenuBar(0);

Sets the menu bar for the main window to menuBar.

Note: QMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time.

QWidget QtGui.QMainWindow.MenuWidget
getset

Returns the menu bar for the main window. This function returns null if a menu bar hasn't been constructed yet.

This function was introduced in Qt 4.2.

Sets the menu bar for the main window to menuBar.

QMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time.

This function was introduced in Qt 4.2.

new QMetaObject QtGui.QMainWindow.StaticMetaObject
staticget
QStatusBar QtGui.QMainWindow.StatusBar
getset

Returns the status bar for the main window. This function creates and returns an empty status bar if the status bar does not exist.

Sets the status bar for the main window to statusbar.

Setting the status bar to 0 will remove it from the main window. Note that QMainWindow takes ownership of the statusbar pointer and deletes it at the appropriate time.

new QTabWidget.TabShape QtGui.QMainWindow.TabShape
getset

This property holds the tab shape used for tabbed dock widgets.

The default is QTabWidget::Rounded.

This property was introduced in Qt 4.5.

new Qt.ToolButtonStyle QtGui.QMainWindow.ToolButtonStyle
getset

This property holds style of toolbar buttons in this mainwindow.

The default is Qt::ToolButtonIconOnly.

Slot<Qt.ToolButtonStyle> QtGui.QMainWindow.ToolButtonStyleChanged
addremove

This signal is emitted when the style used for tool buttons in the window is changed. The new style is passed in toolButtonStyle.

You can connect this signal to other components to help maintain a consistent appearance for your application.

See also setToolButtonStyle().

new bool QtGui.QMainWindow.UnifiedTitleAndToolBarOnMac
getset

This property holds whether the window uses the unified title and toolbar look on Mac OS X.

This property is false by default and only has any effect on Mac OS X 10.4 or higher.

If set to true, then the top toolbar area is replaced with a Carbon HIToolbar or a Cocoa NSToolbar (depending on whether Qt was built with Carbon or Cocoa). All toolbars in the top toolbar area and any toolbars added afterwards are moved to that. This means a couple of things.

QToolBars in this toolbar area are not movable and you cannot drag other toolbars to it

Toolbar breaks are not respected or preserved

Any custom widgets in the toolbar will not be shown if the toolbar becomes too small (only actions will be shown)

Before Qt 4.5, if you called showFullScreen() on the main window, the QToolbar would disappear since it is considered to be part of the title bar. Qt 4.5 and up will now work around this by pulling the toolbars out and back into the regular toolbar and vice versa when you swap out.

Setting this back to false will remove these restrictions.

The Qt::WA_MacBrushedMetal attribute takes precedence over this property.

This property was introduced in Qt 4.3.