KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtquick/views/DockWidget.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
19#ifndef KD_DOCKWIDGET_QUICK_H
20#define KD_DOCKWIDGET_QUICK_H
21
22#include "kddockwidgets/core/views/DockWidgetViewInterface.h"
23#include "kddockwidgets/qtquick/Action.h"
24#include "View.h"
25
26QT_BEGIN_NAMESPACE
27class QQmlEngine;
28QT_END_NAMESPACE
29
30namespace KDDockWidgets {
31
32namespace Core {
33class Group;
34class TitleBar;
35}
36
37namespace QtQuick {
43class DOCKS_EXPORT DockWidget : public QtQuick::View,
45{
46 Q_OBJECT
47 Q_PROPERTY(QObject *actualTitleBar READ actualTitleBarView NOTIFY actualTitleBarChanged)
48 Q_PROPERTY(bool isFocused READ isFocused NOTIFY isFocusedChanged)
49 Q_PROPERTY(bool isFloating READ isFloating WRITE setFloating NOTIFY isFloatingChanged)
50 Q_PROPERTY(QString uniqueName READ uniqueName CONSTANT)
51 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
52 Q_PROPERTY(QObject *guestItem READ guestItem NOTIFY guestItemChanged)
53 Q_PROPERTY(KDDockWidgets::DockWidgetOptions options READ options WRITE setOptions NOTIFY
54 optionsChanged)
55public:
68 explicit DockWidget(const QString &uniqueName, DockWidgetOptions = {},
69 LayoutSaverOptions = {}, Qt::WindowFlags = Qt::Tool,
70 QQmlEngine *engine = nullptr);
71
73 ~DockWidget() override;
74
78 void setGuestItem(const QString &qmlFilename, QQmlContext *context = nullptr);
79
81 Q_INVOKABLE void setGuestItem(QQuickItem *);
82
84 QQuickItem *guestItem() const;
85
87 QSize minSize() const override;
88
90 QSize maxSizeHint() const override;
91
95 QObject *actualTitleBarView() const;
96
99 QQuickItem *groupVisualItem() const;
100
102 Q_INVOKABLE void onGeometryUpdated();
103
104 Q_INVOKABLE KDDockWidgets::QtQuick::Action *toggleAction() const;
105 Q_INVOKABLE KDDockWidgets::QtQuick::Action *floatAction() const;
106
107 std::shared_ptr<Core::View> focusCandidate() const override;
108
109 // Override QQuickItem::show() as there's more to do.
110 void show() override
111 {
112 Core::DockWidgetViewInterface::open();
113 }
114
115 // Override QQuickItem::raise() as there's more to do, like setting it as current tab
116 // if it's tabbed
117 void raise() override
118 {
119 Core::DockWidgetViewInterface::raise();
120 }
121
122#ifdef Q_MOC_RUN
123 // DockWidgetViewInterface is not a QObject, so trick moc
124 Q_INVOKABLE void setAsCurrentTab();
125 Q_INVOKABLE void forceClose();
126 Q_INVOKABLE bool isOpen() const;
127 Q_INVOKABLE void open();
128 Q_INVOKABLE void show();
129 Q_INVOKABLE void raise();
130 Q_INVOKABLE void moveToSideBar();
131#endif
132Q_SIGNALS:
142
143protected:
144 bool event(QEvent *e) override;
145
146private:
147 class Private;
148 Private *const d;
149};
150
151}
152}
153
154#endif
The interface that DockWidget views should implement.
void groupGeometryChanged(QRect)
The geometry of the group container this dock widget is in changed For example, when dragging a dockw...
Class to abstract QAction, so code still works with QtQuick and Flutter.
typedef WindowFlags

© 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