QMainWindow Class Reference |
Constant | Value | Description |
---|---|---|
QMainWindow.AnimatedDocks | 0x01 | Identical to the animated property. |
QMainWindow.AllowNestedDocks | 0x02 | Identical to the dockNestingEnabled property. |
QMainWindow.AllowTabbedDocks | 0x04 | 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. |
QMainWindow.ForceTabbedDocks | 0x08 | 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. |
QMainWindow.VerticalTabs | 0x10 | 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. |
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 in Qt 4.3.
The DockOptions type is a typedef for QFlags<DockOption>. It stores an OR combination of DockOption values.
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs a QMainWindow with the given parent and the specified widget flags.
The dockwidget argument has it's ownership transferred to Qt.
Adds the given dockwidget to the specified area.
The dockwidget argument has it's ownership transferred to Qt.
This is an overloaded member function, provided for convenience.
Adds dockwidget into the given area in the direction specified by the orientation.
The toolbar argument has it's ownership transferred to Qt.
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().
The toolbar argument has it's ownership transferred to Qt.
This is an overloaded member function, provided for convenience.
Equivalent of calling addToolBar(Qt.TopToolBarArea, toolbar)
This is an overloaded member function, provided for convenience.
Creates a QToolBar object, setting its window title to title, and inserts it into the top toolbar area.
See also setWindowTitle().
Adds a toolbar break to the given area after all the other objects that are present.
Returns the central widget for the main window. This function returns zero if the central widget has not been set.
See also setCentralWidget().
Returns the dock widget area that occupies the specified corner.
See also setCorner().
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().
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.
The toolbar argument has it's ownership transferred to Qt.
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().
Inserts a toolbar break before the toolbar specified by before.
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);
See also setMenuBar().
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.
See also setMenuWidget().
The dockwidget argument
Removes the dockwidget from the main window layout and hides it. Note that the dockwidget is not deleted.
The toolbar argument
Removes the toolbar from the main window layout and hides it. Note that the toolbar is not deleted.
Removes a toolbar break previously inserted before the toolbar specified by before.
Restores the state of dockwidget if it is created after the call to restoreState(). Returns true if the state was restored; otherwise returns false.
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.
See also saveState().
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().
See also restoreState().
This method is also a Qt slot with the C++ signature void setAnimated(bool).
The widget argument has it's ownership transferred to Qt.
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.
See also centralWidget().
Sets the given dock widget area to occupy the specified corner.
See also corner().
This method is also a Qt slot with the C++ signature void setDockNestingEnabled(bool).
The menubar argument has it's ownership transferred to Qt.
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.
See also menuBar().
The menubar argument has it's ownership transferred to Qt.
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.
See also menuWidget().
The statusbar argument has it's ownership transferred to Qt.
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.
See also statusBar().
The dockwidget argument has it's ownership transferred to Qt.
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().
Returns the status bar for the main window. This function creates and returns an empty status bar if the status bar does not exist.
See also setStatusBar().
Moves second dock widget on top of first dock widget, creating a tabbed docked area in the main window.
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.
Returns whether there is a toolbar break before the toolbar.
See also addToolBarBreak() and insertToolBarBreak().
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().
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().
PyQt 4.4.4 for Windows | Copyright © Riverbank Computing Ltd and Trolltech AS 2008 | Qt 4.4.2 |