We could just control geometry of the c++ title bar and geometry,
but then the user wouldn't be able to style it, and users rather
style things in QML than subclassing FloatingWindow and writing C++.
So instance some .qml files to represent the drop area and floating
window, so user can muck with.
Hierarchy looks like this now:
-QQuickWindow
--FloatingWindowQuick (C++ QQuickItem)
---FloatingWindow.qml
----TitleBar.qml (reads state from TitleBar c++)
----DropArea.qml
-----DropArea (C++ QQuickItem)
------Frame
etc
33 lines
750 B
QML
33 lines
750 B
QML
/*
|
|
This file is part of KDDockWidgets.
|
|
|
|
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
|
|
|
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
|
*/
|
|
|
|
import QtQuick 2.9
|
|
|
|
Rectangle {
|
|
id: root
|
|
property QtObject frameCpp
|
|
readonly property QtObject titleBarCpp: frameCpp ? frameCpp.titleBar : null
|
|
|
|
color: "cyan"
|
|
anchors.fill: parent
|
|
|
|
TitleBar {
|
|
height: 30
|
|
titleBarCpp: root.titleBarCpp
|
|
visible: true
|
|
anchors {
|
|
top: parent.top
|
|
left: parent.left
|
|
right: parent.right
|
|
}
|
|
}
|
|
}
|