OnlineCop
OnlineCop

Reputation: 4069

Clicking the Apply button on QtQuick Dialog closes dialog

I have defined a QtQuick dialog with 3 buttons: Apply, OK and Cancel:

Dialog {
    id: myDialog
    standardButtons: StandardButton.Apply | StandardButton.Ok | StandardButton.Cancel

    onApply: console.log("Applying data")
    onAccepted: console.log("Saving data")
    onRejected: console.log("Cancel changes to data")

    Item { ... }
}

When I click OK and Cancel, the dialog closes as expected. When I click the Apply button, I would expect the dialog to remain open, but it closes as well.

Is there a way to hook it so the dialog remains open for that button while closing for the other two?

Upvotes: 2

Views: 791

Answers (1)

Oleg Shparber
Oleg Shparber

Reputation: 2752

It's a bug in Qt Quick Dialogs. As you can see here, dialog is closed regardless of what button was clicked. I've just submitted a patch to fix the problem.

Upvotes: 5

Related Questions