Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

QMdiSubWindow Class Reference
[QtGui module]

The QMdiSubWindow class provides a subwindow class for QWorkspace. More...

 #include <QMdiSubWindow>

Inherits QWidget.

This class was introduced in Qt 4.3.

Public Types

Properties

Public Functions

Public Slots

Signals

Protected Functions

Additional Inherited Members


Detailed Description

The QMdiSubWindow class provides a subwindow class for QWorkspace.

It represents the toplevel window in a QWorkspace, and consists of a titlebar with window decorations, an internal widget, and depending on the current style, a window frame.

QMdiSubWindow shares many properties with regular (top-level) windows, but it is designed to work optimally as a subwindow of QWorkspace.

The most common way to construct a QMdiSubWindow is to call QWorkspace::addSubWindow(), but you can also construct one manually, and assign an internal widget by calling setWidget().

By default, QMdiSubWindow keeps itself visible inside the workspace viewport when it is moved around. You can customize this behavior by calling setOption(). You can also set options that enable opaque (rubberband) resize and move.

You can call isShaded() to detect whether the subwindow is currently shaded. To enter shaded mode, call showShaded(). QMdiSubWindow emits the windowStateChanged() signal whenever the window state has changed (i.e., when the window becomes minimized, or is restored). It also emits aboutToActivate() before it is activated.

See also QWorkspace.


Member Type Documentation

enum QMdiSubWindow::SubWindowOption
flags QMdiSubWindow::SubWindowOptions

This enum describes options that you can toggle to customize the behavior of QMdiSubWindow.

ConstantValueDescription
QMdiSubWindow::AllowOutsideArea0x1If you enable this option, QWorkspace will allow this window to move outside the workspace area. This option is disabled by default.
QMdiSubWindow::TransparentResize0x2If you enable this option, QMdiSubWindow will show a rubberband control while resizing, leaving the widget unchanged until the resize operation has completed. In contrast, when this option is disabled, the subwindow will continuously resize as you move the mouse or use the keyboard. By default, this option is disabled.
QMdiSubWindow::TransparentMove0x4If you enable this option, QMdiSubWindow will show a rubberband control while moving, leaving the widget unchanged until the move operation has completed. In contrast, when this option is disabled, the subwindow will continuously move as you move the mouse or use the keyboard. By default, this option is disabled.

The SubWindowOptions type is a typedef for QFlags<SubWindowOption>. It stores an OR combination of SubWindowOption values.


Property Documentation

keyboardPageStep : int

This property holds sets how far a widget should move or resize when using the keyboard page keys.

When in keyboard-interactive mode, you can use the arrow and page keys to either move or resize the window. This property controls the page keys. The common way to enter keyboard interactive mode is to enter the subwindow menu, and select either "resize" or "move".

The default keyboard page step value is 20 pixels.

Access functions:

See also keyboardSingleStep.

keyboardSingleStep : int

This property holds sets how far a widget should move or resize when using the keyboard arrow keys.

When in keyboard-interactive mode, you can use the arrow and page keys to either move or resize the window. This property controls the arrow keys. The common way to enter keyboard interactive mode is to enter the subwindow menu, and select either "resize" or "move".

The default keyboard single step value is 5 pixels.

Access functions:

See also keyboardPageStep.


Member Function Documentation

QMdiSubWindow::QMdiSubWindow ( QWidget * parent = 0, Qt::WindowFlags flags = 0 )

Constructs a new QMdiSubWindow widget. The parent and flags arguments are passed to QWidget's constructor.

See also QWorkspace::addSubWindow().

QMdiSubWindow::~QMdiSubWindow ()

Destructs the subwindow.

See also QWorkspace::removeSubWindow().

void QMdiSubWindow::aboutToActivate ()   [signal]

QMdiSubWindow emits this signal immediately before it is activated.

void QMdiSubWindow::focusInEvent ( QFocusEvent * focusInEvent )   [virtual protected]

QSize QMdiSubWindow::iconSize () const

Returns the size of the titlebar icon. This size depends on the height of the title bar, and is controlled by the current style.

See also QIcon and QStyle::styleHint().

bool QMdiSubWindow::isShaded () const

Returns true if this window is shaded; otherwise returns false.

A window is shaded if it is collapsed so that only the title bar is visible.

void QMdiSubWindow::setOption ( SubWindowOption option, bool on = true )

If on is true, option is enabled on the subwindow. Otherwise, it is disabled. See SubWindowOption for the effect of each option.

See also SubWindowOption and testOption().

void QMdiSubWindow::setSystemMenu ( QMenu * systemMenu )

Sets systemMenu as the current system menu for this subwindow.

QMdiSubWindow creates a system menu by default.

QActions for the system menu created by QMdiSubWindow will automatically be updated depending on the current window state, e.g. will the minimize action be disabled after the window is minimized.

QActions added by the user are not updated by QMdiSubWindow.

QMdiSubWindow takes ownership of systemMenu; you do not have to delete it. Any existing menus will be deleted.

See also systemMenu and showSystemMenu.

void QMdiSubWindow::setWidget ( QWidget * widget )

Sets widget as the internal widget of this subwindow. The widget will be added to the subwindow's base layout.

QMdiSubWindow takes temporary ownership of widget; you do not have to delete it. Any existing internal widget will be removed and reparented to the root window.

See also widget().

void QMdiSubWindow::showShaded ()   [slot]

void QMdiSubWindow::showSystemMenu ()   [slot]

Shows the system menu below the system menu icon in the title bar.

See also setSystemMenu and systemMenu.

QMenu * QMdiSubWindow::systemMenu () const

Returns a pointer to the current system menu or zero if not set.

See also setSystemMenu and showSystemMenu.

bool QMdiSubWindow::testOption ( SubWindowOption option ) const

Returns true if option is enabled; otherwise returns false.

See also SubWindowOption and setOption().

QWidget * QMdiSubWindow::widget () const

Returns a pointer to the current internal widget.

See also setWidget().

void QMdiSubWindow::windowStateChanged ( Qt::WindowStates oldState, Qt::WindowStates newState )   [signal]

QMdiSubWindow emits this signal after the window state changed. oldState is the window state before it changed, and newState is the new, current state.


Copyright © 2007 Trolltech Trademarks
Qt 4.3.0-snapshot-20070202