com.trolltech.qt.gui
Class QMdiSubWindow

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.gui.QWidget
                      extended by com.trolltech.qt.gui.QMdiSubWindow
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QMdiSubWindow
extends QWidget

The QMdiSubWindow class provides a subwindow class for QMdiArea. QMdiSubWindow represents a top-level window in a QMdiArea, and consists of a title bar with window decorations, an internal widget, and (depending on the current style) a window frame and a size grip. QMdiSubWindow has its own layout, which consists of the title bar and a center area for the internal widget.


The most common way to construct a QMdiSubWindow is to call QMdiArea::addSubWindow() with the internal widget as the argument. You can also create a subwindow yourself, and set an internal widget by calling setWidget().

You use the same API when programming with subwindows as with regular top-level windows (e.g., you can call functions such as show(), hide(), showMaximized(), and setWindowTitle()).

Subwindow Handling

QMdiSubWindow also supports behavior specific to subwindows in an MDI area.

By default, each QMdiSubWindow is visible inside the MDI area viewport when moved around, but it is also possible to specify transparent window movement and resizing behavior, where only the outline of a subwindow is updated during these operations. The setOption() function is used to enable this behavior.

The isShaded() function detects whether the subwindow is currently shaded (i.e., the window is collapsed so that only the title bar is visible). To enter shaded mode, call showShaded(). QMdiSubWindow emits the windowStateChanged() signal whenever the window state has changed (e.g., when the window becomes minimized, or is restored). It also emits aboutToActivate() before it is activated.

In keyboard-interactive mode, the windows are moved and resized with the keyboard. You can enter this mode through the system menu of the window. The keyboardSingleStep and keyboardPageStep properties control the distance the widget is moved or resized for each keypress event. When shift is pressed down page step is used; otherwise single step is used.

You can also change the active window with the keyboard. By pressing the control and tab keys at the same time, the next (using the current WindowOrder ) subwindow will be activated. By pressing control, shift, and tab, you will activate the previous window. This is equivalent to calling activateNextSubWindow() and activatePreviousSubWindow(). Note that these shortcuts overrides global shortcuts, but not the QMdiAreas shortcuts.

See also:
QMdiArea.


Nested Class Summary
static class QMdiSubWindow.SubWindowOption
          This enum describes options that customize the behavior of QMdiSubWindow.
static class QMdiSubWindow.SubWindowOptions
           
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 QSignalEmitter.Signal0 aboutToActivate
          QMdiSubWindow emits this signal immediately before it is activated.
 QSignalEmitter.Signal2 windowStateChanged
          This signal takes 2 generic argument(s).
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QMdiSubWindow()
          Constructs a new QMdiSubWindow widget.
QMdiSubWindow(QWidget parent)
          Constructs a new QMdiSubWindow widget.
QMdiSubWindow(QWidget parent, Qt.WindowFlags flags)
          Constructs a new QMdiSubWindow widget.
QMdiSubWindow(QWidget parent, Qt.WindowType[] flags)
          This is an overloaded method provided for convenience.
 
Method Summary
 boolean isShaded()
          Returns true if this window is shaded; otherwise returns false.
 int keyboardPageStep()
          This property holds sets how far a widget should move or resize when using the keyboard page keys.
 int keyboardSingleStep()
          This property holds sets how far a widget should move or resize when using the keyboard arrow keys.
 QMdiArea mdiArea()
          Returns the area containing this sub-window, or 0 if there is none.
 void setKeyboardPageStep(int step)
          This property holds sets how far a widget should move or resize when using the keyboard page keys.
 void setKeyboardSingleStep(int step)
          This property holds sets how far a widget should move or resize when using the keyboard arrow keys.
 void setOption(QMdiSubWindow.SubWindowOption option)
          If on is true, option is enabled on the subwindow; otherwise it is disabled.
 void setOption(QMdiSubWindow.SubWindowOption option, boolean on)
          If on is true, option is enabled on the subwindow; otherwise it is disabled.
 void setSystemMenu(QMenu systemMenu)
          Sets systemMenu as the current system menu for this subwindow.
 void setWidget(QWidget widget)
          Sets widget as the internal widget of this subwindow.
 void showShaded()
          Calling this function makes the subwindow enter the shaded mode.
 void showSystemMenu()
          Shows the system menu below the system menu icon in the title bar.
 QMenu systemMenu()
          Returns a pointer to the current system menu, or zero if no system menu is set.
 boolean testOption(QMdiSubWindow.SubWindowOption arg__1)
          Returns true if option is enabled; otherwise returns false.
 QWidget widget()
          Returns the current internal widget.
 
Methods inherited from class com.trolltech.qt.gui.QWidget
acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, graphicsProxyWidget, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Field Detail

aboutToActivate

public final QSignalEmitter.Signal0 aboutToActivate
QMdiSubWindow emits this signal immediately before it is activated. After the subwindow has been activated, the QMdiArea that manages the subwindow will also emit the subWindowActivated() signal.

See also:
QMdiArea::subWindowActivated() .


windowStateChanged

public final QSignalEmitter.Signal2 windowStateChanged

This signal takes 2 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.core.Qt$WindowStates(named: oldState), com.trolltech.qt.core.Qt$WindowStates(named: newState)>:

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

Constructor Detail

QMdiSubWindow

public QMdiSubWindow(QWidget parent,
                     Qt.WindowType[] flags)
This is an overloaded method provided for convenience.


QMdiSubWindow

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

Instead of using addSubWindow(), it is also simply possible to use setParent() when you add the subwindow to a QMdiArea.

Note that only QMdiSubWindows can be set as children of QMdiArea; you cannot, for instance, write:QMdiArea mdiArea; QTextEdit editor(&mdiArea); // invalid child widget

See also:
QMdiArea::addSubWindow().


QMdiSubWindow

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

Instead of using addSubWindow(), it is also simply possible to use setParent() when you add the subwindow to a QMdiArea.

Note that only QMdiSubWindows can be set as children of QMdiArea; you cannot, for instance, write:QMdiArea mdiArea; QTextEdit editor(&mdiArea); // invalid child widget

See also:
QMdiArea::addSubWindow().


QMdiSubWindow

public QMdiSubWindow(QWidget parent,
                     Qt.WindowFlags flags)
Constructs a new QMdiSubWindow widget. The parent and flags arguments are passed to QWidget's constructor.

Instead of using addSubWindow(), it is also simply possible to use setParent() when you add the subwindow to a QMdiArea.

Note that only QMdiSubWindows can be set as children of QMdiArea; you cannot, for instance, write:QMdiArea mdiArea; QTextEdit editor(&mdiArea); // invalid child widget

See also:
QMdiArea::addSubWindow().

Method Detail

isShaded

public final boolean isShaded()
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.


keyboardPageStep

public final int keyboardPageStep()
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.

See also:
keyboardSingleStep.


keyboardSingleStep

public final int keyboardSingleStep()
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.

See also:
keyboardPageStep.


mdiArea

public final QMdiArea mdiArea()
Returns the area containing this sub-window, or 0 if there is none.

See also:
QMdiArea::addSubWindow().


setKeyboardPageStep

public final void setKeyboardPageStep(int step)
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.

See also:
keyboardSingleStep.


setKeyboardSingleStep

public final void setKeyboardSingleStep(int step)
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.

See also:
keyboardPageStep.


setOption

public final void setOption(QMdiSubWindow.SubWindowOption option)
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().


setOption

public final void setOption(QMdiSubWindow.SubWindowOption option,
                            boolean on)
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().


setSystemMenu

public final void setSystemMenu(QMenu systemMenu)
Sets systemMenu as the current system menu for this subwindow.

By default, each QMdiSubWindow has a standard system menu.

QActions for the system menu created by QMdiSubWindow will automatically be updated depending on the current window state; e.g., the minimize action will 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().


setWidget

public final void setWidget(QWidget widget)
Sets widget as the internal widget of this subwindow. The internal widget is displayed in the center of the subwindow beneath the title bar.

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


showShaded

public final void showShaded()
Calling this function makes the subwindow enter the shaded mode. When the subwindow is shaded, only the title bar is visible.

Although shading is not supported by all styles, this function will still show the subwindow as shaded, regardless of whether support for shading is available. However, when used with styles without shading support, the user will be unable to return from shaded mode through the user interface (e.g., through a shade button in the title bar).

See also:
isShaded().


showSystemMenu

public final void showSystemMenu()
Shows the system menu below the system menu icon in the title bar.

See also:
setSystemMenu(), and systemMenu().


systemMenu

public final QMenu systemMenu()
Returns a pointer to the current system menu, or zero if no system menu is set. QMdiSubWindow provides a default system menu, but you can also set the menu with setSystemMenu().

See also:
setSystemMenu(), and showSystemMenu().


testOption

public final boolean testOption(QMdiSubWindow.SubWindowOption arg__1)
Returns true if option is enabled; otherwise returns false.

See also:
SubWindowOption , and setOption().


widget

public final QWidget widget()
Returns the current internal widget.

See also:
setWidget().