MessageDialog not working on Android Qt6.4.0
-
Good Greetings.
I upgraded from Qt6.3 to Qt 6.4 and MessageDialog stopped working properly. When I click the Ok button after deploying to android device, it does not dismiss the the Message dialog. On desktop it works fine.
The Code is :
"import QtQuick
import QtQuick.Controlsimport QtQuick.Dialogs
ApplicationWindow{
width: 600 height: 200 visible: true id:root color:"green" Button { id: fileButton text: "File" onClicked: menu.open()
Menu {
id: menuAction { text: qsTr("Tool Bar");
onTriggered:{console.log("triggered")
root.color="yellow"}
} Action { text: qsTr("Side Bar"); } Action { text: qsTr("Status Bar"); } Action { text: qsTr("Tool Bar"); } Action { text: qsTr("Side Bar"); } Action { text: qsTr("Status Bar"); } MenuSeparator { contentItem: Rectangle { implicitWidth: 200 implicitHeight: 1 color: "#21be2b" } } Menu { title: qsTr("Advanced") // ... } topPadding: 2 bottomPadding: 2 delegate: MenuItem { id: menuItem implicitWidth: 200 implicitHeight: 40 arrow: Canvas { x: parent.width - width implicitWidth: 40 implicitHeight: 40 visible: menuItem.subMenu onPaint: { var ctx = getContext("2d") ctx.fillStyle = menuItem.highlighted ? "#ffffff" : "#21be2b" ctx.moveTo(15, 15) ctx.lineTo(width - 15, height / 2) ctx.lineTo(15, height - 15) ctx.closePath() ctx.fill() } } indicator: Item { implicitWidth: 40 implicitHeight: 40 Rectangle { width: 26 height: 26 anchors.centerIn: parent visible: menuItem.checkable border.color: "#21be2b" radius: 3 Rectangle { width: 14 height: 14 anchors.centerIn: parent visible: menuItem.checked color: "#21be2b" radius: 2 } } } contentItem: Text { leftPadding: menuItem.indicator.width rightPadding: menuItem.arrow.width text: menuItem.text font: menuItem.font opacity: enabled ? 1.0 : 0.3 color: menuItem.highlighted ? "#ffffff" : "#21be2b" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter elide: Text.ElideRight } background: Rectangle { implicitWidth: 200 implicitHeight: 40 opacity: enabled ? 1 : 0.3 color: menuItem.highlighted ? "#21be2b" : "transparent" } } background: Rectangle { implicitWidth: 200 implicitHeight: 40 color: "#ffffff" border.color: "#21be2b" radius: 2 }
}
}
MessageDialog { id:messB buttons: MessageDialog.Ok text: "The document has been modified." } Component.onCompleted: { messB.open() }
}
"May you please assist in getting the Dialog box to be dissmised.
-
When I add " import Qt.labs.platform " and remove the Button it works fine on android but
when the button is not removed i get this error "W libuntitled30_arm64-v8a.so: QQmlApplicationEngine failed to load component
W libuntitled30_arm64-v8a.so: qrc:/untitled30/main.qml:116:5: Cannot assign to non-existent property "background"
W libuntitled30_arm64-v8a.so: exit app 0"When i add 'QT += widgets' in .pro file (with the Button not removed) the error does not appear, but the Messagedialog does not respond to dismiss the dialog.
It seem like Qt.labs.platform does not work with other import statements