Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40868

StandardButton.Apply in QtQuick Dialog{} does not work in a "standard" way

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.3.0
    • Quick: Dialogs
    • 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.

      Attachments

        1. applybutton.qml
          4 kB
        2. applybutton.qmlproject
          0.5 kB
        3. ChooseDialog.qml
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            longwei_su Longwei Su
            momo Linda Gundal
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes