Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0
-
None
-
Windows 8.1 Pro
-
I48a3bc3c870f1d2f97f923fc24c57abd6594073b
Description
Created a qmlproject with a Dialog {} using the standardButtons: StandardButton.Ok, .Cancel and .Apply. According to the documentation, the Apply button should have the ApplyRole, but it appears to work the same as Ok, meaning 1) it is always enabled and 2) clicking it closes the dialog box. I could not figure out a way to enable and disable this button (depending on whether there were changes in the dialog), or a way to prevent the dialog box from closing - although I found a rather lame workaround for the second problem with the following code:
onApply: {
applyChanges()
open() // workaround! Open the dialog again!
}
The Dialog item does not recognize onClosing, or else I could have just set close.accepted=false!
I finally gave up and switched to using a Window and created my own Ok, Cancel and Apply buttons. Unfortunately, this cannot take advantage of your great feature of automatically adjusting the button layout for different OSs, so it made me rather sad.