Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 friend class QMdiArea;
105#if QT_CONFIG(tabbar)
106 friend class QMdiAreaTabBar;
107#endif
109};
110
111Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiSubWindow::SubWindowOptions)
112
114
115#endif // QMDISUBWINDOW_H
\inmodule QtCore
Definition qcoreevent.h:379
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:562
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:594
\inmodule QtCore
Definition qcoreevent.h:45
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:586
The QKeyEvent class describes a key event.
Definition qevent.h:424
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:196
The QMoveEvent class contains event parameters for move events.
Definition qevent.h:502
\inmodule QtCore
Definition qobject.h:103
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
The QShowEvent class provides an event that is sent when a widget is shown.
Definition qevent.h:578
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
Definition qcoreevent.h:366
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
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)