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:
18
examples/qtquick/customtitlebar/Guest4.qml
Normal file
18
examples/qtquick/customtitlebar/Guest4.qml
Normal 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"
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user