Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmdiarea_container.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3// Qt-Security score:significant reason:default
4
5#ifndef QMDIAREA_CONTAINER_H
6#define QMDIAREA_CONTAINER_H
7
8#include <QtDesigner/container.h>
9
10
11#include <qdesigner_propertysheet_p.h>
12#include <extensionfactory_p.h>
13
14#include <QtWidgets/qmdiarea.h>
15
16QT_BEGIN_NAMESPACE
17
18namespace qdesigner_internal {
19
20// Container for QMdiArea
22{
23 Q_OBJECT
24 Q_INTERFACES(QDesignerContainerExtension)
25public:
26 explicit QMdiAreaContainer(QMdiArea *widget, QObject *parent = nullptr);
27
28 int count() const override;
29 QWidget *widget(int index) const override;
30 int currentIndex() const override;
31 void setCurrentIndex(int index) override;
32 bool canAddWidget() const override { return true; }
33 void addWidget(QWidget *widget) override;
34 void insertWidget(int index, QWidget *widget) override;
35 bool canRemove(int) const override { return true; }
36 void remove(int index) override;
37
38 // Semismart positioning of a new MDI child after cascading
39 static void positionNewMdiChild(const QWidget *area, QWidget *mdiChild);
40
41private:
42 QMdiArea *m_mdiArea;
43};
44
45// PropertySheet for QMdiArea: Fakes window title and name.
46
48{
49 Q_OBJECT
50 Q_INTERFACES(QDesignerPropertySheetExtension)
51public:
52 explicit QMdiAreaPropertySheet(QWidget *mdiArea, QObject *parent = nullptr);
53
54 void setProperty(int index, const QVariant &value) override;
55 bool reset(int index) override;
56 bool isEnabled(int index) const override;
57 bool isChanged(int index) const override;
58 QVariant property(int index) const override;
59
60 // Check whether the property is to be saved. Returns false for the page
61 // properties (as the property sheet has no concept of 'stored')
62 static bool checkProperty(const QString &propertyName);
63
64private:
65 const QString m_windowTitleProperty;
66 QWidget *currentWindow() const;
67 QDesignerPropertySheetExtension *currentWindowSheet() const;
68
69 enum MdiAreaProperty { MdiAreaSubWindowName, MdiAreaSubWindowTitle, MdiAreaNone };
70 static MdiAreaProperty mdiAreaProperty(const QString &name);
71};
72
73// Factories
74
77} // namespace qdesigner_internal
78
79QT_END_NAMESPACE
80
81#endif // QMDIAREA_CONTAINER_H
friend class QWidget
Definition qpainter.h:432
FormEditorOptionsPage(QDesignerFormEditorInterface *core)
QWidget * createPage(QWidget *parent) override
FormEditor(const QStringList &pluginPaths, QObject *parent=nullptr)
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
void addWidget(QWidget *widget) override
static void positionNewMdiChild(const QWidget *area, QWidget *mdiChild)
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
void setProperty(int index, const QVariant &value) override
static bool checkProperty(const QString &propertyName)
QVariant property(int index) const override
QWidget * createPage(QWidget *parent) override
static QString chooseTemplatePath(QDesignerFormEditorInterface *core, QWidget *parent)
#define QT_FORMEDITOR_EXPORT
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define QDESIGNER_SHARED_EXPORT