diff --git a/sandbox/Popups.qml b/sandbox/Popups.qml index 30cfb71f..57d7a430 100644 --- a/sandbox/Popups.qml +++ b/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/src/StatusQ/Popups/StatusModal.qml b/src/StatusQ/Popups/StatusModal.qml index 02b9a3d6..6e0e7702 100644 --- a/src/StatusQ/Popups/StatusModal.qml +++ b/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