File indexing completed on 2025-01-18 10:09:36
0001
0002
0003
0004 #ifndef QMDISUBWINDOW_H
0005 #define QMDISUBWINDOW_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qwidget.h>
0009
0010 QT_REQUIRE_CONFIG(mdiarea);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 class QMenu;
0015 class QMdiArea;
0016
0017 namespace QMdi { class ControlContainer; }
0018 class QMdiSubWindowPrivate;
0019 class Q_WIDGETS_EXPORT QMdiSubWindow : public QWidget
0020 {
0021 Q_OBJECT
0022 Q_PROPERTY(int keyboardSingleStep READ keyboardSingleStep WRITE setKeyboardSingleStep)
0023 Q_PROPERTY(int keyboardPageStep READ keyboardPageStep WRITE setKeyboardPageStep)
0024 public:
0025 enum SubWindowOption {
0026 AllowOutsideAreaHorizontally = 0x1,
0027 AllowOutsideAreaVertically = 0x2,
0028 RubberBandResize = 0x4,
0029 RubberBandMove = 0x8
0030 };
0031 Q_DECLARE_FLAGS(SubWindowOptions, SubWindowOption)
0032
0033 QMdiSubWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
0034 ~QMdiSubWindow();
0035
0036 QSize sizeHint() const override;
0037 QSize minimumSizeHint() const override;
0038
0039 void setWidget(QWidget *widget);
0040 QWidget *widget() const;
0041
0042 QWidget *maximizedButtonsWidget() const;
0043 QWidget *maximizedSystemMenuIconWidget() const;
0044
0045 bool isShaded() const;
0046
0047 void setOption(SubWindowOption option, bool on = true);
0048 bool testOption(SubWindowOption) const;
0049
0050 void setKeyboardSingleStep(int step);
0051 int keyboardSingleStep() const;
0052
0053 void setKeyboardPageStep(int step);
0054 int keyboardPageStep() const;
0055
0056 #if QT_CONFIG(menu)
0057 void setSystemMenu(QMenu *systemMenu);
0058 QMenu *systemMenu() const;
0059 #endif
0060
0061 QMdiArea *mdiArea() const;
0062
0063 Q_SIGNALS:
0064 void windowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
0065 void aboutToActivate();
0066
0067 public Q_SLOTS:
0068 #if QT_CONFIG(menu)
0069 void showSystemMenu();
0070 #endif
0071 void showShaded();
0072
0073 protected:
0074 bool eventFilter(QObject *object, QEvent *event) override;
0075 bool event(QEvent *event) override;
0076 void showEvent(QShowEvent *showEvent) override;
0077 void hideEvent(QHideEvent *hideEvent) override;
0078 void changeEvent(QEvent *changeEvent) override;
0079 void closeEvent(QCloseEvent *closeEvent) override;
0080 void leaveEvent(QEvent *leaveEvent) override;
0081 void resizeEvent(QResizeEvent *resizeEvent) override;
0082 void timerEvent(QTimerEvent *timerEvent) override;
0083 void moveEvent(QMoveEvent *moveEvent) override;
0084 void paintEvent(QPaintEvent *paintEvent) override;
0085 void mousePressEvent(QMouseEvent *mouseEvent) override;
0086 void mouseDoubleClickEvent(QMouseEvent *mouseEvent) override;
0087 void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
0088 void mouseMoveEvent(QMouseEvent *mouseEvent) override;
0089 void keyPressEvent(QKeyEvent *keyEvent) override;
0090 #ifndef QT_NO_CONTEXTMENU
0091 void contextMenuEvent(QContextMenuEvent *contextMenuEvent) override;
0092 #endif
0093 void focusInEvent(QFocusEvent *focusInEvent) override;
0094 void focusOutEvent(QFocusEvent *focusOutEvent) override;
0095 void childEvent(QChildEvent *childEvent) override;
0096
0097 private:
0098 Q_DISABLE_COPY(QMdiSubWindow)
0099 Q_DECLARE_PRIVATE(QMdiSubWindow)
0100 Q_PRIVATE_SLOT(d_func(), void _q_updateStaysOnTopHint())
0101 Q_PRIVATE_SLOT(d_func(), void _q_enterInteractiveMode())
0102 Q_PRIVATE_SLOT(d_func(), void _q_processFocusChanged(QWidget *, QWidget *))
0103 friend class QMdiAreaPrivate;
0104 friend class QMdiArea;
0105 #if QT_CONFIG(tabbar)
0106 friend class QMdiAreaTabBar;
0107 #endif
0108 friend class QMdi::ControlContainer;
0109 };
0110
0111 Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiSubWindow::SubWindowOptions)
0112
0113 QT_END_NAMESPACE
0114
0115 #endif