com.trolltech.qt.gui
Class QMdiSubWindow

java.lang.Object
  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.

See Also:
QMdiArea

Nested Class Summary
static class QMdiSubWindow.SubWindowOption
          This enum describes options that customize the behavior of QMdiSubWindow.
static class QMdiSubWindow.SubWindowOptions
          This QFlag class provides flags for the int enum.
 
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.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Field Summary
 QSignalEmitter.Signal0 aboutToActivate
          QMdiSubWindow emits this signal immediately before it is activated.
 QSignalEmitter.Signal2<Qt.WindowStates,Qt.WindowStates> windowStateChanged
          QMdiSubWindow emits this signal after the window state changes.
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Constructor Summary
QMdiSubWindow()
          Equivalent to QMdiSubWindow(0, 0).
QMdiSubWindow(QWidget parent)
          Equivalent to QMdiSubWindow(parent, 0).
QMdiSubWindow(QWidget parent, Qt.WindowFlags flags)
          Constructs a new QMdiSubWindow widget.
 
Method Summary
protected  void changeEvent(QEvent changeEvent)
          This function is reimplemented for internal reasons.
protected  void childEvent(QChildEvent childEvent)
          This function is reimplemented for internal reasons.
protected  void closeEvent(QCloseEvent closeEvent)
          This function is reimplemented for internal reasons.
protected  void contextMenuEvent(QContextMenuEvent contextMenuEvent)
          This function is reimplemented for internal reasons.
 boolean event(QEvent event)
          This function is reimplemented for internal reasons.
 boolean eventFilter(QObject object, QEvent event)
          This function is reimplemented for internal reasons.
protected  void focusInEvent(QFocusEvent focusInEvent)
          This function is reimplemented for internal reasons.
protected  void focusOutEvent(QFocusEvent focusOutEvent)
          This function is reimplemented for internal reasons.
static QMdiSubWindow fromNativePointer(QNativePointer nativePointer)
          This function returns the QMdiSubWindow instance pointed to by nativePointer
protected  void hideEvent(QHideEvent hideEvent)
          This function is reimplemented for internal reasons.
 boolean isShaded()
          Returns true if this window is shaded; otherwise returns false.
 int keyboardPageStep()
          Returns sets how far a widget should move or resize when using the keyboard page keys..
 int keyboardSingleStep()
          Returns sets how far a widget should move or resize when using the keyboard arrow keys..
protected  void keyPressEvent(QKeyEvent keyEvent)
          This function is reimplemented for internal reasons.
protected  void leaveEvent(QEvent leaveEvent)
          This function is reimplemented for internal reasons.
 QWidget maximizedButtonsWidget()
          This method is used internally by Qt Jambi.
 QWidget maximizedSystemMenuIconWidget()
          This method is used internally by Qt Jambi.
 QSize minimumSizeHint()
          This function is reimplemented for internal reasons.
protected  void mouseDoubleClickEvent(QMouseEvent mouseEvent)
          This function is reimplemented for internal reasons.
protected  void mouseMoveEvent(QMouseEvent mouseEvent)
          This function is reimplemented for internal reasons.
protected  void mousePressEvent(QMouseEvent mouseEvent)
          This function is reimplemented for internal reasons.
protected  void mouseReleaseEvent(QMouseEvent mouseEvent)
          This function is reimplemented for internal reasons.
protected  void moveEvent(QMoveEvent moveEvent)
          This function is reimplemented for internal reasons.
protected  void paintEvent(QPaintEvent paintEvent)
          This function is reimplemented for internal reasons.
protected  void resizeEvent(QResizeEvent resizeEvent)
          This function is reimplemented for internal reasons.
 void setKeyboardPageStep(int step)
          Sets sets how far a widget should move or resize when using the keyboard page keys.
 void setKeyboardSingleStep(int step)
          Sets sets how far a widget should move or resize when using the keyboard arrow keys.
 void setOption(QMdiSubWindow.SubWindowOption option)
          Equivalent to setOption(option, true).
 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.
protected  void showEvent(QShowEvent showEvent)
          This function is reimplemented for internal reasons.
 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.
 QSize sizeHint()
          This function is reimplemented for internal reasons.
 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 arg__1 is enabled; otherwise returns false.
protected  void timerEvent(QTimerEvent timerEvent)
          This function is reimplemented for internal reasons.
 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, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, contentsRect, contextMenuPolicy, createWinId, cursor, depth, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, ensurePolished, enterEvent, focusNextChild, focusNextPrevChild, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyReleaseEvent, layout, layoutDirection, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumWidth, mouseGrabber, move, move, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, overrideWindowState, paintEngine, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, 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, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showFullScreen, showMaximized, showMinimized, showNormal, size, 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, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
blockSignals, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
disconnect, disconnect, signalSender
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, 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.

Compatible Slot Signature:
void mySlot()
See Also:
QMdiArea::subWindowActivated


windowStateChanged

public final QSignalEmitter.Signal2<Qt.WindowStates,Qt.WindowStates> windowStateChanged

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

Compatible Slot Signatures:
void mySlot(com.trolltech.qt.core.Qt.WindowStates oldState, com.trolltech.qt.core.Qt.WindowStates newState)
void mySlot(com.trolltech.qt.core.Qt.WindowStates oldState)
void mySlot()

Constructor Detail

QMdiSubWindow

public QMdiSubWindow(QWidget parent)

Equivalent to QMdiSubWindow(parent, 0).


QMdiSubWindow

public QMdiSubWindow()

Equivalent to QMdiSubWindow(0, 0).


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

Returns 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:
setKeyboardPageStep, keyboardSingleStep

keyboardSingleStep

public final int keyboardSingleStep()

Returns 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:
setKeyboardSingleStep, keyboardPageStep

maximizedButtonsWidget

public final QWidget maximizedButtonsWidget()

This method is used internally by Qt Jambi. Do not use it in your applications.


maximizedSystemMenuIconWidget

public final QWidget maximizedSystemMenuIconWidget()

This method is used internally by Qt Jambi. Do not use it in your applications.


setKeyboardPageStep

public final void setKeyboardPageStep(int step)

Sets sets how far a widget should move or resize when using the keyboard page keys. to step.

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:
keyboardPageStep, keyboardSingleStep

setKeyboardSingleStep

public final void setKeyboardSingleStep(int step)

Sets sets how far a widget should move or resize when using the keyboard arrow keys. to step.

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:
keyboardSingleStep, keyboardPageStep

setOption

public final void setOption(QMdiSubWindow.SubWindowOption option)

Equivalent to setOption(option, true).


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, 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, 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, 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, showSystemMenu

testOption

public final boolean testOption(QMdiSubWindow.SubWindowOption arg__1)

Returns true if arg__1 is enabled; otherwise returns false.

See Also:
SubWindowOption, setOption

widget

public final QWidget widget()

Returns the current internal widget.

See Also:
setWidget

changeEvent

protected void changeEvent(QEvent changeEvent)

This function is reimplemented for internal reasons.

Overrides:
changeEvent in class QWidget

childEvent

protected void childEvent(QChildEvent childEvent)

This function is reimplemented for internal reasons.

Overrides:
childEvent in class QObject
See Also:
event

closeEvent

protected void closeEvent(QCloseEvent closeEvent)

This function is reimplemented for internal reasons.

Overrides:
closeEvent in class QWidget
See Also:
event, hide, close, QCloseEvent, Application Example

contextMenuEvent

protected void contextMenuEvent(QContextMenuEvent contextMenuEvent)

This function is reimplemented for internal reasons.

Overrides:
contextMenuEvent in class QWidget
See Also:
event, QContextMenuEvent, customContextMenuRequested

event

public boolean event(QEvent event)

This function is reimplemented for internal reasons.

Overrides:
event in class QWidget
See Also:
closeEvent, focusInEvent, focusOutEvent, enterEvent, keyPressEvent, keyReleaseEvent, leaveEvent, mouseDoubleClickEvent, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, moveEvent, paintEvent, resizeEvent, QObject::event, QObject::timerEvent

eventFilter

public boolean eventFilter(QObject object,
                           QEvent event)

This function is reimplemented for internal reasons.

Overrides:
eventFilter in class QObject
See Also:
installEventFilter

focusInEvent

protected void focusInEvent(QFocusEvent focusInEvent)

This function is reimplemented for internal reasons.

Overrides:
focusInEvent in class QWidget
See Also:
focusOutEvent, setFocusPolicy, keyPressEvent, keyReleaseEvent, event, QFocusEvent

focusOutEvent

protected void focusOutEvent(QFocusEvent focusOutEvent)

This function is reimplemented for internal reasons.

Overrides:
focusOutEvent in class QWidget
See Also:
focusInEvent, setFocusPolicy, keyPressEvent, keyReleaseEvent, event, QFocusEvent

hideEvent

protected void hideEvent(QHideEvent hideEvent)

This function is reimplemented for internal reasons.

Overrides:
hideEvent in class QWidget
See Also:
visible, event, QHideEvent

keyPressEvent

protected void keyPressEvent(QKeyEvent keyEvent)

This function is reimplemented for internal reasons.

Overrides:
keyPressEvent in class QWidget
See Also:
keyReleaseEvent, QKeyEvent::ignore, setFocusPolicy, focusInEvent, focusOutEvent, event, QKeyEvent, Tetrix Example

leaveEvent

protected void leaveEvent(QEvent leaveEvent)

This function is reimplemented for internal reasons.

Overrides:
leaveEvent in class QWidget
See Also:
enterEvent, mouseMoveEvent, event

minimumSizeHint

public QSize minimumSizeHint()

This function is reimplemented for internal reasons.

Overrides:
minimumSizeHint in class QWidget
See Also:
QSize::isValid, resize, setMinimumSize, sizePolicy

mouseDoubleClickEvent

protected void mouseDoubleClickEvent(QMouseEvent mouseEvent)

This function is reimplemented for internal reasons.

Overrides:
mouseDoubleClickEvent in class QWidget
See Also:
mousePressEvent, mouseReleaseEvent, mouseMoveEvent, event, QMouseEvent

mouseMoveEvent

protected void mouseMoveEvent(QMouseEvent mouseEvent)

This function is reimplemented for internal reasons.

Overrides:
mouseMoveEvent in class QWidget
See Also:
setMouseTracking, mousePressEvent, mouseReleaseEvent, mouseDoubleClickEvent, event, QMouseEvent, Example

mousePressEvent

protected void mousePressEvent(QMouseEvent mouseEvent)

This function is reimplemented for internal reasons.

Overrides:
mousePressEvent in class QWidget
See Also:
mouseReleaseEvent, mouseDoubleClickEvent, mouseMoveEvent, event, QMouseEvent, Example

mouseReleaseEvent

protected void mouseReleaseEvent(QMouseEvent mouseEvent)

This function is reimplemented for internal reasons.

Overrides:
mouseReleaseEvent in class QWidget
See Also:
mousePressEvent, mouseDoubleClickEvent, mouseMoveEvent, event, QMouseEvent, Example

moveEvent

protected void moveEvent(QMoveEvent moveEvent)

This function is reimplemented for internal reasons.

Overrides:
moveEvent in class QWidget
See Also:
resizeEvent, event, move, QMoveEvent

paintEvent

protected void paintEvent(QPaintEvent paintEvent)

This function is reimplemented for internal reasons.

Overrides:
paintEvent in class QWidget
See Also:
event, repaint, update, QPainter, QPixmap, QPaintEvent, Analog Clock Example

resizeEvent

protected void resizeEvent(QResizeEvent resizeEvent)

This function is reimplemented for internal reasons.

Overrides:
resizeEvent in class QWidget
See Also:
moveEvent, event, resize, QResizeEvent, paintEvent, Example

showEvent

protected void showEvent(QShowEvent showEvent)

This function is reimplemented for internal reasons.

Overrides:
showEvent in class QWidget
See Also:
visible, event, QShowEvent

sizeHint

public QSize sizeHint()

This function is reimplemented for internal reasons.

Overrides:
sizeHint in class QWidget
See Also:
QSize::isValid, minimumSizeHint, sizePolicy, setMinimumSize, updateGeometry

timerEvent

protected void timerEvent(QTimerEvent timerEvent)

This function is reimplemented for internal reasons.

Overrides:
timerEvent in class QObject
See Also:
startTimer, killTimer, event

fromNativePointer

public static QMdiSubWindow fromNativePointer(QNativePointer nativePointer)
This function returns the QMdiSubWindow instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.