CopperSpice API  1.9.2
QMdiSubWindow Class Reference

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

Inheritance diagram for QMdiSubWindow:
QWidget QObject QPaintDevice

Public Typedefs

using SubWindowOptions = QFlags< SubWindowOption >
 
- Public Typedefs inherited from QWidget
using RenderFlags = QFlags< RenderFlag >
 

Public Types

enum  SubWindowOption
 
- Public Types inherited from QWidget
enum  RenderFlag
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 

Public Signals

void aboutToActivate ()
 
void windowStateChanged (Qt::WindowStates oldState, Qt::WindowStates newState)
 
- Public Signals inherited from QWidget
void customContextMenuRequested (const QPoint &pos)
 
void windowIconChanged (const QIcon &icon)
 
void windowIconTextChanged (const QString &iconText)
 
void windowTitleChanged (const QString &title)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Slots

void showShaded ()
 
void showSystemMenu ()
 
- Public Slots inherited from QWidget
bool close ()
 
void hide ()
 
void lower ()
 
void raise ()
 
void repaint ()
 
void setDisabled (bool disable)
 
void setEnabled (bool enable)
 
void setFocus ()
 
void setHidden (bool hidden)
 
void setStyleSheet (const QString &styleSheet)
 
virtual void setVisible (bool visible)
 
void setWindowModified (bool modified)
 
void setWindowTitle (const QString &title)
 
void show ()
 
void showFullScreen ()
 
void showMaximized ()
 
void showMinimized ()
 
void showNormal ()
 
void update ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

 QMdiSubWindow (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
 ~QMdiSubWindow ()
 
bool isShaded () const
 
int keyboardPageStep () const
 
int keyboardSingleStep () const
 
QMdiAreamdiArea () const
 
QSize minimumSizeHint () const override
 
void setKeyboardPageStep (int step)
 
void setKeyboardSingleStep (int step)
 
void setOption (SubWindowOption option, bool on=true)
 
void setSystemMenu (QMenu *systemMenu)
 
void setWidget (QWidget *widget)
 
QSize sizeHint () const override
 
QMenusystemMenu () const
 
bool testOption (SubWindowOption option) const
 
QWidgetwidget () const
 
- Public Methods inherited from QWidget
 QWidget (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
 ~QWidget ()
 
bool acceptDrops () const
 
QString accessibleDescription () const
 
QString accessibleName () const
 
QList< QAction * > actions () const
 
void activateWindow ()
 
void addAction (QAction *action)
 
void addActions (const QList< QAction * > &actions)
 
void adjustSize ()
 
bool autoFillBackground () const
 
QPalette::ColorRole backgroundRole () const
 
QBackingStorebackingStore () const
 
QSize baseSize () const
 
QWidget * childAt (const QPoint &position) const
 
QWidget * childAt (int x, int y) const
 
QRect childrenRect () const
 
QRegion childrenRegion () const
 
void clearFocus ()
 
void clearMask ()
 
QMargins contentsMargins () const
 
QRect contentsRect () const
 
Qt::ContextMenuPolicy contextMenuPolicy () const
 
QCursor cursor () const
 
WId effectiveWinId () const
 
void ensurePolished () const
 
Qt::FocusPolicy focusPolicy () const
 
QWidget * focusProxy () const
 
QWidget * focusWidget () const
 
const QFontfont () const
 
QFontInfo fontInfo () const
 
QFontMetrics fontMetrics () const
 
QPalette::ColorRole foregroundRole () const
 
QRect frameGeometry () const
 
QSize frameSize () const
 
const QRectgeometry () const
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 
QPixmap grab (const QRect &rectangle=QRect (QPoint (0, 0), QSize (-1,-1)))
 
void grabGesture (Qt::GestureType gestureType, Qt::GestureFlags flags=Qt::GestureFlags ())
 
void grabKeyboard ()
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut)
 
QGraphicsEffectgraphicsEffect () const
 
QGraphicsProxyWidgetgraphicsProxyWidget () const
 
bool hasEditFocus () const
 
bool hasFocus () const
 
virtual bool hasHeightForWidth () const
 
bool hasMouseTracking () const
 
int height () const
 
virtual int heightForWidth (int width) const
 
Qt::InputMethodHints inputMethodHints () const
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
void insertAction (QAction *before, QAction *action)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
bool isActiveWindow () const
 
bool isAncestorOf (const QWidget *child) const
 
bool isEnabled () const
 
bool isEnabledTo (const QWidget *parent) const
 
bool isEnabledToTLW () const
 
bool isFullScreen () const
 
bool isHidden () const
 
bool isMaximized () const
 
bool isMinimized () const
 
bool isModal () const
 
bool isTopLevel () const
 
bool isVisible () const
 
bool isVisibleTo (const QWidget *parent) const
 
bool isWindow () const
 
bool isWindowModified () const
 
QLayoutlayout () const
 
Qt::LayoutDirection layoutDirection () const
 
QLocale locale () const
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapFromParent (const QPoint &pos) const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QPoint mapToParent (const QPoint &pos) const
 
QRegion mask () const
 
int maximumHeight () const
 
QSize maximumSize () const
 
int maximumWidth () const
 
int minimumHeight () const
 
QSize minimumSize () const
 
int minimumWidth () const
 
void move (const QPoint &point)
 
void move (int x, int y)
 
QWidget * nativeParentWidget () const
 
QWidget * nextInFocusChain () const
 
QRect normalGeometry () const
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
QPaintEnginepaintEngine () const override
 
const QPalettepalette () const
 
QWidget * parentWidget () const
 
QPoint pos () const
 
QWidget * previousInFocusChain () const
 
QRect rect () const
 
void releaseKeyboard ()
 
void releaseMouse ()
 
void releaseShortcut (int id)
 
void removeAction (QAction *action)
 
void render (QPaintDevice *target, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren))
 
void render (QPainter *painter, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren))
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &region)
 
void repaint (int x, int y, int w, int h)
 
void resize (const QSize &size)
 
void resize (int w, int h)
 
bool restoreGeometry (const QByteArray &geometry)
 
QByteArray saveGeometry () const
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &rect)
 
void setAcceptDrops (bool on)
 
void setAccessibleDescription (const QString &description)
 
void setAccessibleName (const QString &name)
 
void setAttribute (Qt::WidgetAttribute attribute, bool enable=true)
 
void setAutoFillBackground (bool enable)
 
void setBackgroundRole (QPalette::ColorRole role)
 
void setBaseSize (const QSize &size)
 
void setBaseSize (int basew, int baseh)
 
void setContentsMargins (const QMargins &margins)
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void setCursor (const QCursor &cursor)
 
void setEditFocus (bool enable)
 
void setFixedHeight (int h)
 
void setFixedSize (const QSize &size)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFocus (Qt::FocusReason reason)
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
void setFocusProxy (QWidget *widget)
 
void setFont (const QFont &font)
 
void setForegroundRole (QPalette::ColorRole role)
 
void setGeometry (const QRect &rect)
 
void setGeometry (int x, int y, int w, int h)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
void setLayout (QLayout *layout)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setLocale (const QLocale &locale)
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
void setMaximumHeight (int maxh)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int maxw, int maxh)
 
void setMaximumWidth (int maxw)
 
void setMinimumHeight (int minh)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int minw, int minh)
 
void setMinimumWidth (int minw)
 
void setMouseTracking (bool enable)
 
void setPalette (const QPalette &palette)
 
void setParent (QWidget *parent)
 
void setParent (QWidget *parent, Qt::WindowFlags flags)
 
void setShortcutAutoRepeat (int id, bool enable=true)
 
void setShortcutEnabled (int id, bool enable=true)
 
void setSizeIncrement (const QSize &size)
 
void setSizeIncrement (int w, int h)
 
void setSizePolicy (QSizePolicy policy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
void setStatusTip (const QString &data)
 
void setStyle (QStyle *style)
 
void setToolTip (const QString &data)
 
void setToolTipDuration (int msec)
 
void setUpdatesEnabled (bool enable)
 
void setWhatsThis (const QString &str)
 
void setWindowFilePath (const QString &filePath)
 
void setWindowFlags (Qt::WindowFlags flags)
 
void setWindowIcon (const QIcon &icon)
 
void setWindowModality (Qt::WindowModality windowModality)
 
void setWindowOpacity (qreal level)
 
void setWindowRole (const QString &role)
 
void setWindowState (Qt::WindowStates windowState)
 
QSize size () const
 
QSize sizeIncrement () const
 
QSizePolicy sizePolicy () const
 
void stackUnder (QWidget *widget)
 
QString statusTip () const
 
QStylestyle () const
 
QString styleSheet () const
 
bool testAttribute (Qt::WidgetAttribute attribute) const
 
QString toolTip () const
 
int toolTipDuration () const
 
QWidget * topLevelWidget () const
 
bool underMouse () const
 
void ungrabGesture (Qt::GestureType gestureType)
 
void unsetCursor ()
 
void unsetLayoutDirection ()
 
void unsetLocale ()
 
void update (const QRect &rect)
 
void update (const QRegion &region)
 
void update (int x, int y, int w, int h)
 
void updateGeometry ()
 
bool updatesEnabled () const
 
QRegion visibleRegion () const
 
QString whatsThis () const
 
int width () const
 
QWidget * window () const
 
QString windowFilePath () const
 
Qt::WindowFlags windowFlags () const
 
QWindowwindowHandle () const
 
QIcon windowIcon () const
 
Qt::WindowModality windowModality () const
 
qreal windowOpacity () const
 
QString windowRole () const
 
Qt::WindowStates windowState () const
 
QString windowTitle () const
 
Qt::WindowType windowType () const
 
WId winId () const
 
int x () const
 
int y () const
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 
- Public Methods inherited from QPaintDevice
virtual ~QPaintDevice ()
 
int colorCount () const
 
int depth () const
 
int devicePixelRatio () const
 
qreal devicePixelRatioF () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int width () const
 
int widthMM () const
 

Protected Methods

void changeEvent (QEvent *changeEvent) override
 
void childEvent (QChildEvent *childEvent) override
 
void closeEvent (QCloseEvent *closeEvent) override
 
void contextMenuEvent (QContextMenuEvent *contextMenuEvent) override
 
bool event (QEvent *event) override
 
bool eventFilter (QObject *object, QEvent *event) override
 
void focusInEvent (QFocusEvent *focusInEvent) override
 
void focusOutEvent (QFocusEvent *focusOutEvent) override
 
void hideEvent (QHideEvent *hideEvent) override
 
void keyPressEvent (QKeyEvent *keyEvent) override
 
void leaveEvent (QEvent *leaveEvent) override
 
void mouseDoubleClickEvent (QMouseEvent *mouseEvent) override
 
void mouseMoveEvent (QMouseEvent *mouseEvent) override
 
void mousePressEvent (QMouseEvent *mouseEvent) override
 
void mouseReleaseEvent (QMouseEvent *mouseEvent) override
 
void moveEvent (QMoveEvent *moveEvent) override
 
void paintEvent (QPaintEvent *paintEvent) override
 
void resizeEvent (QResizeEvent *resizeEvent) override
 
void showEvent (QShowEvent *showEvent) override
 
void timerEvent (QTimerEvent *timerEvent) override
 
- Protected Methods inherited from QWidget
virtual void actionEvent (QActionEvent *event)
 
void create (WId window=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
void destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual void enterEvent (QEvent *event)
 
bool event (QEvent *event) override
 
bool focusNextChild ()
 
virtual bool focusNextPrevChild (bool next)
 
bool focusPreviousChild ()
 
void initPainter (QPainter *painter) const override
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
int metric (PaintDeviceMetric metric) const override
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void tabletEvent (QTabletEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Methods inherited from QPaintDevice
 QPaintDevice ()
 

Properties

 keyboardPageStep
 
 keyboardSingleStep
 
- Properties inherited from QWidget
 acceptDrops
 
 accessibleDescription
 
 accessibleName
 
 autoFillBackground
 
 baseSize
 
 childrenRect
 
 childrenRegion
 
 contextMenuPolicy
 
 cursor
 
 enabled
 
 focus
 
 focusPolicy
 
 font
 
 frameGeometry
 
 frameSize
 
 fullScreen
 
 geometry
 
 height
 
 inputMethodHints
 
 isActiveWindow
 
 layoutDirection
 
 locale
 
 maximized
 
 maximumHeight
 
 maximumSize
 
 maximumWidth
 
 minimized
 
 minimumHeight
 
 minimumSize
 
 minimumSizeHint
 
 minimumWidth
 
 modal
 
 mouseTracking
 
 normalGeometry
 
 palette
 
 pos
 
 rect
 
 size
 
 sizeHint
 
 sizeIncrement
 
 sizePolicy
 
 statusTip
 
 styleSheet
 
 toolTip
 
 updatesEnabled
 
 visible
 
 whatsThis
 
 width
 
 windowFilePath
 
 windowFlags
 
 windowIcon
 
 windowIconText
 
 windowModality
 
 windowModified
 
 windowOpacity
 
 windowTitle
 
 x
 
 y
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Methods inherited from QWidget
static QWidget * createWindowContainer (QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
static QWidget * find (WId id)
 
static QWidget * keyboardGrabber ()
 
static QWidget * mouseGrabber ()
 
static void setTabOrder (QWidget *firstWidget, QWidget *secondWidget)
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Protected Slots inherited from QWidget
void updateMicroFocus ()
 

Detailed Description

The QMdiSubWindow class provides a subwindow class for QMdiArea. This class 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. For example, you can call methods 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() method is used to enable this behavior.

The isShaded() method detects whether the subwindow is currently shaded and drawn with only the title bar visible. To enter shaded mode call showShaded(). QMdiSubWindow emits the windowStateChanged() signal whenever the window state has changed because the window is 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

Member Typedef Documentation

Typedef for QFlags<SubWindowOption> which contains an OR combination of SubWindowOption values.

Refer to QMdiSubWindow::SubWindowOption for the enum documentation.

Member Enumeration Documentation

This enum describes options that customize the behavior of QMdiSubWindow.

ConstantValueDescription
QMdiSubWindow::RubberBandResize0x4 If you enable this option, a rubber band control is used to represent the subwindow's outline, and the user resizes this instead of the subwindow itself. As a result, the subwindow maintains its original position and size until the resize operation has been completed, at which time it will receive a single QResizeEvent. By default, this option is disabled.
QMdiSubWindow::RubberBandMove0x8 If you enable this option, a rubber band control is used to represent the subwindow's outline, and the user moves this instead of the subwindow itself. As a result, the subwindow remains in its original position until the move operation has completed, at which time a QMoveEvent is sent to the window. By default, this option is disabled.

Constructor & Destructor Documentation

QMdiSubWindow::QMdiSubWindow ( QWidget parent = nullptr,
Qt::WindowFlags  flags = Qt::EmptyFlag 
)

Constructs a new QMdiSubWindow widget. The parent and flags arguments are passed to QWidget's constructor. Instead of using addSubWindow() it is also possible to use setParent() when you add the subwindow to a QMdiArea.

Only QMdiSubWindows can be set as children of a QMdiArea. The following is an example of code which should not be used.

QTextEdit editor(&mdiArea); // invalid child widget
See also
QMdiArea::addSubWindow()
QMdiSubWindow::~QMdiSubWindow ( )

Destroys the subwindow.

See also
QMdiArea::removeSubWindow()

Method Documentation

void QMdiSubWindow::aboutToActivate ( )
signal

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()
void QMdiSubWindow::changeEvent ( QEvent changeEvent)
overrideprotectedvirtual

Reimplemented from QWidget::changeEvent()

void QMdiSubWindow::childEvent ( QChildEvent childEvent)
overrideprotected

Reimplemented from QObject::childEvent()

void QMdiSubWindow::closeEvent ( QCloseEvent closeEvent)
overrideprotectedvirtual

Reimplemented from QWidget::closeEvent()

void QMdiSubWindow::contextMenuEvent ( QContextMenuEvent contextMenuEvent)
overrideprotectedvirtual

Reimplemented from QWidget::contextMenuEvent()

bool QMdiSubWindow::event ( QEvent event)
overrideprotected

Reimplemented from QWidget::event()

bool QMdiSubWindow::eventFilter ( QObject object,
QEvent event 
)
overrideprotected

Reimplemented from QObject::eventFilter()

void QMdiSubWindow::focusInEvent ( QFocusEvent focusInEvent)
overrideprotectedvirtual

Reimplemented from QWidget::focusInEvent()

void QMdiSubWindow::focusOutEvent ( QFocusEvent focusOutEvent)
overrideprotectedvirtual

Reimplemented from QWidget::focusOutEvent()

void QMdiSubWindow::hideEvent ( QHideEvent hideEvent)
overrideprotectedvirtual

Reimplemented from QWidget::hideEvent()

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.

int QMdiSubWindow::keyboardPageStep ( ) const

Returns the value of the property.

int QMdiSubWindow::keyboardSingleStep ( ) const

Returns the value of the property.

void QMdiSubWindow::keyPressEvent ( QKeyEvent keyEvent)
overrideprotectedvirtual

Reimplemented from QWidget::keyPressEvent()

void QMdiSubWindow::leaveEvent ( QEvent leaveEvent)
overrideprotectedvirtual

Reimplemented from QWidget::leaveEvent()

QMdiArea * QMdiSubWindow::mdiArea ( ) const

Returns the area containing this sub-window or a nullptr if there is none.

See also
QMdiArea::addSubWindow()
QSize QMdiSubWindow::minimumSizeHint ( ) const
overridevirtual

Reimplemented from QWidget::minimumSizeHint()

void QMdiSubWindow::mouseDoubleClickEvent ( QMouseEvent mouseEvent)
overrideprotectedvirtual
void QMdiSubWindow::mouseMoveEvent ( QMouseEvent mouseEvent)
overrideprotectedvirtual

Reimplemented from QWidget::mouseMoveEvent()

void QMdiSubWindow::mousePressEvent ( QMouseEvent mouseEvent)
overrideprotectedvirtual

Reimplemented from QWidget::mousePressEvent()

void QMdiSubWindow::mouseReleaseEvent ( QMouseEvent mouseEvent)
overrideprotectedvirtual

Reimplemented from QWidget::mouseReleaseEvent()

void QMdiSubWindow::moveEvent ( QMoveEvent moveEvent)
overrideprotectedvirtual

Reimplemented from QWidget::moveEvent()

void QMdiSubWindow::paintEvent ( QPaintEvent paintEvent)
overrideprotectedvirtual

Reimplemented from QWidget::paintEvent()

void QMdiSubWindow::resizeEvent ( QResizeEvent resizeEvent)
overrideprotectedvirtual

Reimplemented from QWidget::resizeEvent()

void QMdiSubWindow::setKeyboardPageStep ( int  step)

Sets the value of the property to step.

void QMdiSubWindow::setKeyboardSingleStep ( int  step)

Sets the value of the property to step.

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

If on is true the given window option is enabled on the subwindow, otherwise it is disabled. Refer to SubWindowOption for the effect of each option.

See also
SubWindowOption, testOption()
void QMdiSubWindow::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. For example, 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()
void QMdiSubWindow::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()
void QMdiSubWindow::showEvent ( QShowEvent showEvent)
overrideprotectedvirtual

Reimplemented from QWidget::showEvent()

void QMdiSubWindow::showShaded ( )
slot

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()
void QMdiSubWindow::showSystemMenu ( )
slot

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

See also
setSystemMenu(), systemMenu()
QSize QMdiSubWindow::sizeHint ( ) const
overridevirtual

Reimplemented from QWidget::sizeHint()

QMenu * QMdiSubWindow::systemMenu ( ) const

Returns a pointer to the current system menu or zero if no system menu is set. QMdiSubWindow provides a default system menu. You can also set the menu with setSystemMenu().

See also
setSystemMenu(), showSystemMenu()
bool QMdiSubWindow::testOption ( SubWindowOption  option) const

Returns true if option is enabled, otherwise returns false.

See also
SubWindowOption, setOption()
void QMdiSubWindow::timerEvent ( QTimerEvent timerEvent)
overrideprotected

Reimplemented from QObject::timerEvent()

QWidget * QMdiSubWindow::widget ( ) const

Returns 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 changes. The oldState is the window state before it changed, and newState is the new current state.

Property Documentation

QMdiSubWindow::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
PropertiesClass Methods
read keyboardPageStep
write setKeyboardPageStep
QMdiSubWindow::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
PropertiesClass Methods
read keyboardSingleStep
write setKeyboardSingleStep