KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
DockWidgetInstantiator.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_DOCKWIDGET_INSTANTIATOR_P_H
13#define KD_DOCKWIDGET_INSTANTIATOR_P_H
14
17
18#include <QQmlParserStatus>
19#include <QQuickItem>
20#include <QString>
21
22#include <optional>
23
24namespace KDDockWidgets {
25
35class DockWidgetInstantiator : public QQuickItem
36{
37 Q_OBJECT
39 Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
40 Q_PROPERTY(KDDockWidgets::QtQuick::DockWidget *dockWidget READ dockWidget NOTIFY
43 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
44 Q_PROPERTY(bool isFocused READ isFocused NOTIFY isFocusedChanged)
45 Q_PROPERTY(bool isFloating READ isFloating WRITE setFloating NOTIFY isFloatingChanged)
46 Q_PROPERTY(bool isOpen READ isOpen NOTIFY isOpenChanged)
48public:
50 ~DockWidgetInstantiator() override;
51
52 QString uniqueName() const;
53 void setUniqueName(const QString &);
54
55 QString source() const;
56 void setSource(const QString &);
57
58 KDDockWidgets::QtQuick::DockWidget *dockWidget() const;
59 KDDockWidgets::Core::DockWidget *controller() const;
60 QObject *actualTitleBar() const;
61
62 QString title() const;
63 void setTitle(const QString &title);
64
65 bool isFocused() const;
66 bool isFloating() const;
67 bool isOpen() const;
68 void setFloating(bool);
69 QVector<QString> affinities() const;
70 void setAffinities(const QVector<QString> &);
71
72 Q_INVOKABLE void addDockWidgetAsTab(QQuickItem *other,
74
75 Q_INVOKABLE void addDockWidgetToContainingWindow(QQuickItem *other,
77 QQuickItem *relativeTo = nullptr,
78 QSize initialSize = {},
80
81 Q_INVOKABLE void setAsCurrentTab();
82 Q_INVOKABLE void forceClose();
83 Q_INVOKABLE bool close();
84 Q_INVOKABLE void open();
85 Q_INVOKABLE void show();
86 Q_INVOKABLE void raise();
87 Q_INVOKABLE void moveToSideBar();
88
95 Q_INVOKABLE void deleteDockWidget();
96
97protected:
98 void classBegin() override;
99 void componentComplete() override;
100
101Q_SIGNALS:
108 void closed();
109 void guestViewChanged(QQuickItem *);
110 void optionsChanged(KDDockWidgets::DockWidgetOptions);
114 void isOpenChanged(bool);
116 void windowActiveAboutToChange(bool activated);
118
119private:
120 class Private;
121 Private *const d;
122};
123}
124
125#endif
Indirection helper to instantiate dock widgets from QML.
Q_INVOKABLE void addDockWidgetToContainingWindow(QQuickItem *other, KDDockWidgets::Location location, QQuickItem *relativeTo=nullptr, QSize initialSize={}, KDDockWidgets::InitialVisibilityOption={})
void windowActiveAboutToChange(bool activated)
void setAffinities(const QVector< QString > &)
KDDockWidgets::QtQuick::DockWidget * dockWidget
void titleChanged(const QString &title)
KDDockWidgets::Core::DockWidget * controller() const
void optionsChanged(KDDockWidgets::DockWidgetOptions)
Q_INVOKABLE void addDockWidgetAsTab(QQuickItem *other, KDDockWidgets::InitialVisibilityOption={})
Class to abstract QAction, so code still works with QtQuick and Flutter.
Represents a dock widget.

© 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