diff --git a/ui/StatusQ/sandbox/Popups.qml b/ui/StatusQ/sandbox/Popups.qml index 30cfb71ffb..57d7a4301c 100644 --- a/ui/StatusQ/sandbox/Popups.qml +++ b/ui/StatusQ/sandbox/Popups.qml @@ -33,6 +33,11 @@ Column { onClicked: modalExample.open() } + StatusButton { + text: "Modal with changable content" + onClicked: modalWithContentAccess.open() + } + StatusModal { id: simpleModal anchors.centerIn: parent @@ -142,4 +147,28 @@ Column { icon.name: "info" } } + + StatusModal { + id: modalWithContentAccess + anchors.centerIn: parent + header.title: "Header" + header.subTitle: "SubTitle" + + content: StatusBaseText { + id: text + anchors.centerIn: parent + text: "Some text content" + font.pixelSize: 15 + color: Theme.palette.directColor1 + } + + rightButtons: [ + StatusButton { + text: "Change text" + onClicked: { + modalWithContentAccess.contentComponent.text = "Changed!" + } + } + ] + } } diff --git a/ui/StatusQ/src/StatusQ/Popups/StatusModal.qml b/ui/StatusQ/src/StatusQ/Popups/StatusModal.qml index 02b9a3d64b..6e0e7702a6 100644 --- a/ui/StatusQ/src/StatusQ/Popups/StatusModal.qml +++ b/ui/StatusQ/src/StatusQ/Popups/StatusModal.qml @@ -16,6 +16,7 @@ QC.Popup { property alias headerActionButton: headerImpl.actionButton property StatusModalHeaderSettings header: StatusModalHeaderSettings {} + property alias contentComponent: contentLoader.item property alias rightButtons: footerImpl.rightButtons property alias leftButtons: footerImpl.leftButtons @@ -56,6 +57,7 @@ QC.Popup { } Loader { + id: contentLoader active: true anchors.horizontalCenter: parent.horizontalCenter sourceComponent: statusModal.content