Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qmdisubwindow.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QMDISUBWINDOW_H
5#define QMDISUBWINDOW_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qwidget.h>
9
11
13
14class QMenu;
15class QMdiArea;
16
17namespace QMdi { class ControlContainer; }
19class Q_WIDGETS_EXPORT QMdiSubWindow : public QWidget
20{
22 Q_PROPERTY(int keyboardSingleStep READ keyboardSingleStep WRITE setKeyboardSingleStep)
23 Q_PROPERTY(int keyboardPageStep READ keyboardPageStep WRITE setKeyboardPageStep)
24public:
26 AllowOutsideAreaHorizontally = 0x1, // internal
27 AllowOutsideAreaVertically = 0x2, // internal
28 RubberBandResize = 0x4,
29 RubberBandMove = 0x8
30 };
31 Q_DECLARE_FLAGS(SubWindowOptions, SubWindowOption)
32
33 QMdiSubWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
35
36 QSize sizeHint() const override;
37 QSize minimumSizeHint() const override;
38
40 QWidget *widget() const;
41
42 QWidget *maximizedButtonsWidget() const; // internal
43 QWidget *maximizedSystemMenuIconWidget() const; // internal
44
45 bool isShaded() const;
46
47 void setOption(SubWindowOption option, bool on = true);
48 bool testOption(SubWindowOption) const;
49
50 void setKeyboardSingleStep(int step);
51 int keyboardSingleStep() const;
52
53 void setKeyboardPageStep(int step);
54 int keyboardPageStep() const;
55
56#if QT_CONFIG(menu)
57 void setSystemMenu(QMenu *systemMenu);
58 QMenu *systemMenu() const;
59#endif
60
61 QMdiArea *mdiArea() const;
62
64 void windowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
66
67public Q_SLOTS:
68#if QT_CONFIG(menu)
69 void showSystemMenu();
70#endif
71 void showShaded();
72
73protected:
74 bool eventFilter(QObject *object, QEvent *event) override;
75 bool event(QEvent *event) override;
76 void showEvent(QShowEvent *showEvent) override;
77 void hideEvent(QHideEvent *hideEvent) override;
78 void changeEvent(QEvent *changeEvent) override;
79 void closeEvent(QCloseEvent *closeEvent) override;
80 void leaveEvent(QEvent *leaveEvent) override;
81 void resizeEvent(QResizeEvent *resizeEvent) override;
82 void timerEvent(QTimerEvent *timerEvent) override;
83 void moveEvent(QMoveEvent *moveEvent) override;
84 void paintEvent(QPaintEvent *paintEvent) override;
85 void mousePressEvent(QMouseEvent *mouseEvent) override;
86 void mouseDoubleClickEvent(QMouseEvent *mouseEvent) override;
87 void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
88 void mouseMoveEvent(QMouseEvent *mouseEvent) override;
89 void keyPressEvent(QKeyEvent *keyEvent) override;
90#ifndef QT_NO_CONTEXTMENU
91 void contextMenuEvent(QContextMenuEvent *contextMenuEvent) override;
92#endif
93 void focusInEvent(QFocusEvent *focusInEvent) override;
94 void focusOutEvent(QFocusEvent *focusOutEvent) override;
95 void childEvent(QChildEvent *childEvent) override;
96
97private:
98 Q_DISABLE_COPY(QMdiSubWindow)
99 Q_DECLARE_PRIVATE(QMdiSubWindow)
100 Q_PRIVATE_SLOT(d_func(), void _q_updateStaysOnTopHint())
101 Q_PRIVATE_SLOT(d_func(), void _q_enterInteractiveMode())
102 Q_PRIVATE_SLOT(d_func(), void _q_processFocusChanged(QWidget *, QWidget *))
103 friend class QMdiAreaPrivate;
104#if QT_CONFIG(tabbar)
105 friend class QMdiAreaTabBar;
106#endif
108};
109
110Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiSubWindow::SubWindowOptions)
111
113
114#endif // QMDISUBWINDOW_H
\inmodule QtCore
Definition qcoreevent.h:372
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:561
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:593
\inmodule QtCore
Definition qcoreevent.h:45
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:585
The QKeyEvent class describes a key event.
Definition qevent.h:423
The QMdiArea widget provides an area in which MDI windows are displayed.
Definition qmdiarea.h:21
The QMdiSubWindow class provides a subwindow class for QMdiArea.
SubWindowOption
This enum describes options that customize the behavior of QMdiSubWindow.
void windowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState)
QMdiSubWindow emits this signal after the window state changes.
void aboutToActivate()
QMdiSubWindow emits this signal immediately before it is activated.
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
\inmodule QtGui
Definition qevent.h:195
The QMoveEvent class contains event parameters for move events.
Definition qevent.h:501
\inmodule QtCore
Definition qobject.h:90
virtual void childEvent(QChildEvent *event)
This event handler can be reimplemented in a subclass to receive child events.
Definition qobject.cpp:1471
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
Definition qobject.cpp:1518
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition qobject.cpp:1433
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:485
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:547
The QShowEvent class provides an event that is sent when a widget is shown.
Definition qevent.h:577
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
Definition qcoreevent.h:359
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
virtual void hideEvent(QHideEvent *event)
This event handler can be reimplemented in a subclass to receive widget hide events.
virtual void leaveEvent(QEvent *event)
This event handler can be reimplemented in a subclass to receive widget leave events which are passed...
Definition qwidget.cpp:9777
virtual void mouseMoveEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
Definition qwidget.cpp:9507
virtual void closeEvent(QCloseEvent *event)
This event handler is called with the given event when Qt receives a window close request for a top-l...
Definition qwidget.cpp:9902
virtual void mousePressEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
Definition qwidget.cpp:9529
virtual void mouseDoubleClickEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse double click...
Definition qwidget.cpp:9576
virtual void focusInEvent(QFocusEvent *event)
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
Definition qwidget.cpp:9711
virtual void mouseReleaseEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
Definition qwidget.cpp:9554
virtual void moveEvent(QMoveEvent *event)
This event handler can be reimplemented in a subclass to receive widget move events which are passed ...
Definition qwidget.cpp:9847
QSize minimumSizeHint
the recommended minimum size for the widget
Definition qwidget.h:149
virtual void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
Definition qwidget.cpp:9428
QSize sizeHint
the recommended size for the widget
Definition qwidget.h:148
virtual void focusOutEvent(QFocusEvent *event)
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
Definition qwidget.cpp:9737
virtual void resizeEvent(QResizeEvent *event)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
Definition qwidget.cpp:9868
virtual void keyPressEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
Definition qwidget.cpp:9652
virtual void paintEvent(QPaintEvent *event)
This event handler can be reimplemented in a subclass to receive paint events passed in event.
Definition qwidget.cpp:9829
virtual void showEvent(QShowEvent *event)
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
virtual void contextMenuEvent(QContextMenuEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive widget context men...
Definition qwidget.cpp:9921
QOpenGLWidget * widget
[1]
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLbitfield flags
struct _cl_event * event
GLuint GLenum option
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
static void showSystemMenu(QWindow *w)
scrollArea setWidget(imageLabel)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent