diff --git a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml index cc91fbb42a8bf57bbd5fd716e4af1c00543452bf..d114377561bf3e4b3278b4efb314bd287f59fc30 100644 --- a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml @@ -123,6 +123,7 @@ Item { else lastChosen.text = (clickedButton == StandardButton.Retry ? "(Retry)" : "(Ignore)") } + onRejected: lastChosen.text = "Rejected" Calendar { id: calendar @@ -136,6 +137,9 @@ Item { modality: dialogModal.checked ? Qt.WindowModal : Qt.NonModal title: customizeTitle.checked ? windowTitleField.text : "Customized content" onRejected: lastChosen.text = "Rejected" + onAccepted: lastChosen.text = "Accepted " + + (clickedButton === StandardButton.Retry ? "(Retry)" : "(OK)") + onButtonClicked: if (clickedButton === StandardButton.Retry) lastChosen.text = "Retry" contentItem: Rectangle { color: "lightskyblue" implicitWidth: 400 @@ -145,6 +149,8 @@ Item { color: "navy" anchors.centerIn: parent } + Keys.onPressed: if (event.key === Qt.Key_R && (event.modifiers & Qt.ControlModifier)) filledDialog.click(StandardButton.Retry) + Keys.onEnterPressed: filledDialog.accept() Keys.onEscapePressed: filledDialog.reject() Keys.onBackPressed: filledDialog.reject() // especially necessary on Android }