qtquick: Allow to add the guest widget declaratively

This is an alternative to setting source
This commit is contained in:
Sergio Martins
2021-04-05 16:22:56 +01:00
parent 15d4f77d5d
commit ead9e8945e
3 changed files with 23 additions and 8 deletions

View File

@@ -33,6 +33,15 @@ KDDW.MainWindowLayout {
source: ":/Another.qml"
}
KDDW.DockWidget {
id: dock5
uniqueName: "dock5"
Rectangle {
id: guest
color: "pink"
}
}
Button {
text: "Toggle Another"
anchors {
@@ -43,10 +52,10 @@ KDDW.MainWindowLayout {
z: 10
onClicked: {
if (dock4.dockWidget.visible) {
dock4.dockWidget.close();
if (dock5.dockWidget.visible) {
dock5.dockWidget.close();
} else {
dock4.dockWidget.show();
dock5.dockWidget.show();
}
}
}