KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
MainWindowInstantiator.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_INSTANTIATOR_P_H
13#define KD_MAIN_WINDOW_INSTANTIATOR_P_H
14#pragma once
15
16#include "kddockwidgets/docks_export.h"
17#include "kddockwidgets/KDDockWidgets.h"
18
19#include <QQuickItem>
20
21namespace KDDockWidgets {
22
23namespace Core {
24class MainWindow;
25class SideBar;
26}
27
30class DOCKS_EXPORT MainWindowInstantiator : public QQuickItem
31{
32 Q_OBJECT
33 Q_PROPERTY(QString uniqueName READ uniqueName WRITE setUniqueName NOTIFY uniqueNameChanged)
34 Q_PROPERTY(KDDockWidgets::MainWindowOptions options READ options WRITE setOptions NOTIFY
35 optionsChanged)
36 Q_PROPERTY(bool isMDI READ isMDI CONSTANT)
37 Q_PROPERTY(QVector<QString> affinities READ affinities WRITE setAffinities NOTIFY affinitiesChanged)
38public:
41
42 QString uniqueName() const;
43 void setUniqueName(const QString &);
44
45 KDDockWidgets::MainWindowOptions options() const;
46 void setOptions(KDDockWidgets::MainWindowOptions);
47
48 QVector<QString> affinities() const;
49 void setAffinities(const QVector<QString> &);
50
51 bool isMDI() const;
52
54 Q_INVOKABLE void addDockWidget(QQuickItem *dockWidget, KDDockWidgets::Location location,
55 QQuickItem *relativeTo = nullptr, QSize initialSize = {},
57
59 Q_INVOKABLE void addDockWidgetAsTab(QQuickItem *dockWidget);
60
61 Q_INVOKABLE void layoutEqually();
62 Q_INVOKABLE void layoutParentContainerEqually(QQuickItem *dockWidget);
63 Q_INVOKABLE void moveToSideBar(QQuickItem *);
64 Q_INVOKABLE void moveToSideBar(QQuickItem *, KDDockWidgets::SideBarLocation);
65 Q_INVOKABLE void restoreFromSideBar(QQuickItem *);
66 Q_INVOKABLE void overlayOnSideBar(QQuickItem *);
67 Q_INVOKABLE void toggleOverlayOnSideBar(QQuickItem *);
68 Q_INVOKABLE void clearSideBarOverlay(bool deleteFrame = true);
69 Q_INVOKABLE bool sideBarIsVisible(KDDockWidgets::SideBarLocation) const;
70 Q_INVOKABLE bool closeDockWidgets(bool force = false);
71
72protected:
73 void classBegin() override;
74 void componentComplete() override;
75
76Q_SIGNALS:
80
81private:
82 QString m_uniqueName;
83 Core::MainWindow *m_mainWindow = nullptr;
84 QVector<QString> m_affinities;
85 KDDockWidgets::MainWindowOptions m_options = KDDockWidgets::MainWindowOption_None;
86};
87
88}
89
90#endif
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
A wrapper to workaround the limitation that QtQuick can't pass arguments through MainWindow's ctor So...
Class to abstract QAction, so code still works with QtQuick and Flutter.
SideBarLocation
Each main window supports 4 sidebars.

© 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