QMdiArea Class Reference |
Constant | Value | Description |
---|---|---|
QMdiArea.DontMaximizeSubWindowOnActivation | 0x1 | When the active subwindow is maximized, the default behavior is to maximize the next subwindow that is activated. Set this option if you do not want this behavior. |
The AreaOptions type is a typedef for QFlags<AreaOption>. It stores an OR combination of AreaOption values.
This enum describes the view mode of the area; i.e. how sub-windows will be displayed.
Constant | Value | Description |
---|---|---|
QMdiArea.SubWindowView | 0 | Display sub-windows with window frames (default). |
QMdiArea.TabbedView | 1 | Display sub-windows with tabs in a tab bar. |
This enum was introduced in Qt 4.4.
See also setViewMode().
Specifies the criteria to use for ordering the list of child windows returned by subWindowList(). The functions cascadeSubWindows() and tileSubWindows() follow this order when arranging the windows.
Constant | Value | Description |
---|---|---|
QMdiArea.CreationOrder | 0 | The windows are returned in the order of their creation. |
QMdiArea.StackingOrder | 1 | The windows are returned in the order in which they are stacked, with the top-most window being last in the list. |
QMdiArea.ActivationHistoryOrder | 2 | The windows are returned in the order in which they were activated. |
See also subWindowList().
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs an empty mdi area. parent is passed to QWidget's constructor.
This method is also a Qt slot with the C++ signature void activateNextSubWindow().
Gives the keyboard focus to the next window in the list of child windows. The windows are activated in the order in which they are created (CreationOrder).
See also activatePreviousSubWindow().
This method is also a Qt slot with the C++ signature void activatePreviousSubWindow().
Gives the keyboard focus to the previous window in the list of child windows. The windows are activated in the order in which they are created (CreationOrder).
See also activateNextSubWindow().
Returns a pointer to the current active subwindow. If no window is currently active, 0 is returned.
Subwindows are treated as top-level windows with respect to window state, i.e., if a widget outside the MDI area is the active window, no subwindow will be active. Note that if a widget in the window in which the MDI area lives gains focus, the window will be activated.
See also setActiveSubWindow() and Qt.WindowState.
The widget argument has it's ownership transferred to Qt.
Adds widget as a new subwindow to the MDI area. If windowFlags are non-zero, they will override the flags set on the widget.
The widget can be either a QMdiSubWindow or another QWidget (in which case the MDI area will create a subwindow and set the widget as the internal widget).
Note: Once the subwindow has been added, its parent will be the viewport widget of the QMdiArea.
QMdiArea mdiArea; QMdiSubWindow *subWindow1 = new QMdiSubWindow; subWindow1->setWidget(internalWidget1); subWindow1->setAttribute(Qt.WA_DeleteOnClose); mdiArea.addSubWindow(subWindow1); QMdiSubWindow *subWindow2 = mdiArea.addSubWindow(internalWidget2);
When you create your own subwindow, you must set the Qt.WA_DeleteOnClose widget attribute if you want the window to be deleted when closed in the MDI area. If not, the window will be hidden and the MDI area will not activate the next subwindow.
Returns the QMdiSubWindow that is added to the MDI area.
See also removeSubWindow().
This method is also a Qt slot with the C++ signature void cascadeSubWindows().
Arranges all the child windows in a cascade pattern.
See also tileSubWindows().
This method is also a Qt slot with the C++ signature void closeActiveSubWindow().
Closes the active subwindow.
See also closeAllSubWindows().
This method is also a Qt slot with the C++ signature void closeAllSubWindows().
Closes all subwindows by sending a QCloseEvent to each window. You may receive subWindowActivated() signals from subwindows before they are closed (if the MDI area activates the subwindow when another is closing).
Subwindows that ignore the close event will remain open.
See also closeActiveSubWindow().
Returns a pointer to the current subwindow, or 0 if there is no current subwindow.
This function will return the same as activeSubWindow() if the QApplication containing QMdiArea is active.
See also activeSubWindow() and QApplication.activeWindow().
Removes widget from the MDI area. The widget must be either a QMdiSubWindow or a widget that is the internal widget of a subwindow. Note that the subwindow is not deleted by QMdiArea and that its parent is set to 0.
See also addSubWindow().
This method is also a Qt slot with the C++ signature void setActiveSubWindow(QMdiSubWindow *).
Activates the subwindow window. If window is 0, any current active window is deactivated.
See also activeSubWindow().
If on is true, option is enabled on the MDI area; otherwise it is disabled. See AreaOption for the effect of each option.
See also AreaOption and testOption().
This slot is called by QAbstractScrollArea after setViewport() has been called. Reimplement this function in a subclass of QMdiArea to initialize the new viewport before it is used.
See also setViewport().
Returns a list of all subwindows in the MDI area. If order is CreationOrder (the default), the windows are sorted in the order in which they were inserted into the workspace. If order is StackingOrder, the windows are listed in their stacking order, with the topmost window as the last item in the list. If order is ActivationHistoryOrder, the windows are listed according to their recent activation history.
See also WindowOrder.
Returns true if option is enabled; otherwise returns false.
See also AreaOption and setOption().
This method is also a Qt slot with the C++ signature void tileSubWindows().
Arranges all child windows in a tile pattern.
See also cascadeSubWindows().
QMdiArea emits this signal after window has been activated. When window is 0, QMdiArea has just deactivated its last active window, and there are no active windows on the workspace.
See also QMdiArea.activeSubWindow().
PyQt 4.4.4 for Windows | Copyright © Riverbank Computing Ltd and Trolltech AS 2008 | Qt 4.4.2 |