KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtquick/views/MainWindow.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#ifndef KD_MAIN_WINDOW_QUICK_P_H
13#define KD_MAIN_WINDOW_QUICK_P_H
14
15#include "View.h"
16#include "kddockwidgets/core/views/MainWindowViewInterface.h"
17
18#include <QString>
19
20namespace KDDockWidgets {
21
22namespace Core {
23class SideBar;
24}
25
26namespace QtQuick {
27
35
36class DOCKS_EXPORT MainWindow : public QtQuick::View, public Core::MainWindowViewInterface
37{
38 Q_OBJECT
39 Q_PROPERTY(QVector<QString> affinities READ affinities CONSTANT)
40 Q_PROPERTY(QString uniqueName READ uniqueName CONSTANT)
41 Q_PROPERTY(KDDockWidgets::MainWindowOptions options READ options CONSTANT)
42 Q_PROPERTY(bool isMDI READ isMDI CONSTANT)
43public:
50 explicit MainWindow(const QString &uniqueName, MainWindowOptions options = {},
51 QQuickItem *parent = nullptr, Qt::WindowFlags flags = {});
52
53 ~MainWindow() override;
54
56 QSize minSize() const override;
57
59 QSize maxSizeHint() const override;
60
63 void setPersistentCentralView(const QString &qmlFilename);
64
65#ifdef Q_MOC_RUN
66 Q_INVOKABLE bool closeDockWidgets(bool force = false);
67 Q_INVOKABLE bool sideBarIsVisible(KDDockWidgets::SideBarLocation) const;
68 Q_INVOKABLE void clearSideBarOverlay(bool deleteFrame = true);
69 Q_INVOKABLE void layoutEqually();
70 Q_INVOKABLE bool anySideBarIsVisible() const;
71
72 Q_INVOKABLE void moveToSideBar(const QString &dockId);
73 Q_INVOKABLE void moveToSideBar(const QString &dockId, KDDockWidgets::SideBarLocation);
74 Q_INVOKABLE void restoreFromSideBar(const QString &dockId);
75 Q_INVOKABLE void overlayOnSideBar(const QString &dockId);
76 Q_INVOKABLE void toggleOverlayOnSideBar(const QString &dockId);
77 Q_INVOKABLE void layoutParentContainerEqually(const QString &dockId);
78 Q_INVOKABLE void addDockWidgetAsTab(const QString &dockId);
79 Q_INVOKABLE void addDockWidget(const QString &dockId, KDDockWidgets::Location,
80 const QString &relativeToDockId = {},
82
83#endif
84
85protected:
86 QMargins centerWidgetMargins() const override;
87 QRect centralAreaGeometry() const override;
88 void setContentsMargins(int left, int top, int right, int bottom) override;
89
90private:
91 class Private;
92 Private *const d;
93};
94}
95}
96
97#endif
The interface that MainWindow views should implement.
A docking area for dock widgets Named MainWindow as it's the QtWidgets/QMainWindow counterpart....
QSize maxSizeHint() const override
Reimplemented for internal purposes. .
QRect centralAreaGeometry() const override
QMargins centerWidgetMargins() const override
void setContentsMargins(int left, int top, int right, int bottom) override
QSize minSize() const override
Reimplemented for internal purposes. .
void setPersistentCentralView(const QString &qmlFilename)
Class to abstract QAction, so code still works with QtQuick and Flutter.
SideBarLocation
Each main window supports 4 sidebars.
typedef WindowFlags
Struct describing the preferred dock widget size and visibility when adding it to a layout.

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8