I have a silly little custom MessageDialog that is intended to solicit confirmation from a user before deleting DLC. Here is the code:
import QtQuick 2.5
import QtQuick.Dialogs 1.2
MessageDialog {
id: root
property string dlcName: ""
icon: StandardIcon.Information
title: qsTr("Delete content")
text: qsTr("<p>You are about to delete '" + dlcName + "'. " +
"If you wish to access this content in future, you will have to re-download it.</p>" +
"<p>Tap 'OK' when you are ready to proceed.</p>")
standardButtons: StandardButton.Cancel | StandardButton.Ok
}
import QtQuick 2.5
import QtQuick.Dialogs 1.2
MessageDialog {
id: root
property string dlcName: ""
icon: StandardIcon.Information
title: qsTr("Delete content")
text: qsTr("<p>You are about to delete '" + dlcName + "'. " +
"If you wish to access this content in future, you will have to re-download it.</p>" +
"<p>Tap 'OK' when you are ready to proceed.</p>")
standardButtons: StandardButton.Cancel | StandardButton.Ok
}
To copy to clipboard, switch view to plain text mode
And here is the calling code:
Item {
id: root
signal deletionRequested(string dlcName)
function alertDeletion(name) {
deleteDialog.dlcName = name
deleteDialog.open()
}
anchors.fill: parent
DeleteDLCDialog {
id: deleteDialog
onAccepted: root.deletionRequested(dlcName)
}
....
}
Item {
id: root
signal deletionRequested(string dlcName)
function alertDeletion(name) {
deleteDialog.dlcName = name
deleteDialog.open()
}
anchors.fill: parent
DeleteDLCDialog {
id: deleteDialog
onAccepted: root.deletionRequested(dlcName)
}
....
}
To copy to clipboard, switch view to plain text mode
This works great on Desktop (i.e., MacOSX) and Android, but no dialog appears on iOS. Console logging shows that the alertDeletion function is called. If I change MessageDialog to FileDialog (and comment out the now-invalid properties, of course) then I see a file dialog as expected.
I found a bug about this here. But it's somewhat old, the "workaround" posted in the comments doesn't work for me, and I can't find anything else. I've tried running in debug and release mode, with no difference. Is this still an issue in others' experience? Is it solvable, and if so, how? If not, what is the recommended workaround?
I'm running Qt Creator 4.1.0, based on Qt 5.7.0 (Clang 7.0 (Apple), 64 bit).
Thank you very much!
Bookmarks