examples|qtquick: Show a .qml dockwidget as well

The customtitlebar example only had C++ dock widgets. Now it
has a .qml one too.

While testing issue #325
This commit is contained in:
Sergio Martins
2022-11-15 18:39:36 +00:00
parent 8ff052e219
commit d64ff8c6cd
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio 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
Guest {
anchors.fill: parent
background: "qrc:/assets/triangles.png"
logo: "qrc:/assets/KDAB_bubble_white.png"
}

View File

@@ -23,5 +23,20 @@ ApplicationWindow {
anchors.fill: parent
uniqueName: "MyMainLayout"
KDDW.DockWidget {
id: dock4
uniqueName: "dock4"
source: "qrc:/Guest4.qml"
onIsFocusedChanged: {
console.log("Dock4 focus changed to: " + isFocused);
}
}
Component.onCompleted: {
// The other 3 dock widgets are created via C++ in main.cpp
// For illustration purposes, here's a .qml version. Maybe it's te preferred form even.
addDockWidget(dock4, KDDW.KDDockWidgets.Location_OnBottom);
}
}
}

View File

@@ -4,6 +4,7 @@
<file>Guest1.qml</file>
<file>Guest2.qml</file>
<file>Guest3.qml</file>
<file>Guest4.qml</file>
<file>Guest.qml</file>
<file>MyTitleBar.qml</file>
</qresource>