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
4#ifndef QMDIAREA_CONTAINER_H
5#define QMDIAREA_CONTAINER_H
6
7#include <QtDesigner/container.h>
8
9
10#include <qdesigner_propertysheet_p.h>
11#include <extensionfactory_p.h>
12
13#include <QtWidgets/qmdiarea.h>
14
15QT_BEGIN_NAMESPACE
16
17namespace qdesigner_internal {
18
19// Container for QMdiArea
21{
22 Q_OBJECT
23 Q_INTERFACES(QDesignerContainerExtension)
24public:
25 explicit QMdiAreaContainer(QMdiArea *widget, QObject *parent = nullptr);
26
27 int count() const override;
28 QWidget *widget(int index) const override;
29 int currentIndex() const override;
30 void setCurrentIndex(int index) override;
31 bool canAddWidget() const override { return true; }
32 void addWidget(QWidget *widget) override;
33 void insertWidget(int index, QWidget *widget) override;
34 bool canRemove(int) const override { return true; }
35 void remove(int index) override;
36
37 // Semismart positioning of a new MDI child after cascading
38 static void positionNewMdiChild(const QWidget *area, QWidget *mdiChild);
39
40private:
41 QMdiArea *m_mdiArea;
42};
43
44// PropertySheet for QMdiArea: Fakes window title and name.
45
47{
48 Q_OBJECT
49 Q_INTERFACES(QDesignerPropertySheetExtension)
50public:
51 explicit QMdiAreaPropertySheet(QWidget *mdiArea, QObject *parent = nullptr);
52
53 void setProperty(int index, const QVariant &value) override;
54 bool reset(int index) override;
55 bool isEnabled(int index) const override;
56 bool isChanged(int index) const override;
57 QVariant property(int index) const override;
58
59 // Check whether the property is to be saved. Returns false for the page
60 // properties (as the property sheet has no concept of 'stored')
61 static bool checkProperty(const QString &propertyName);
62
63private:
64 const QString m_windowTitleProperty;
65 QWidget *currentWindow() const;
66 QDesignerPropertySheetExtension *currentWindowSheet() const;
67
68 enum MdiAreaProperty { MdiAreaSubWindowName, MdiAreaSubWindowTitle, MdiAreaNone };
69 static MdiAreaProperty mdiAreaProperty(const QString &name);
70};
71
72// Factories
73
76} // namespace qdesigner_internal
77
78QT_END_NAMESPACE
79
80#endif // QMDIAREA_CONTAINER_H
friend class QWidget
Definition qpainter.h:421
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