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

QML MessageDialog doesn't describe how to handle buttonClicked signal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.4.0 Beta1
    • 6.0, 6.1, 6.2, 6.3
    • Documentation
    • None
    • All
    • df36473e94 (qt/qtdeclarative/dev) df36473e94 (qt/tqtc-qtdeclarative/dev)

      The documentation for the QML MessageDialog type does not describe how to handle the buttonClicked signal. It has parameters that are from QPlatformDialogHelper:
      QPlatformDialogHelper::StandardButton button and
      QPlatformDialogHelper::ButtonRole role, however it is not clear if you need to import the type to access them, nor does it describe what the enum values are (nor that it is an enum). It is also using C++ syntax for the parameters, not QML (I presume that is an auto-translation issue). One can guess that it matches the QMessageBox documentation, but not everyone is going to make that connection.

      There also appears to be no examples using MessageDialog that I could find. I did find some tests that test the functionality, which shows that my assumptions about the button argument type is wrong, but they do not test the role functionality - so I do not know what type the role argument is - or how to check its values.

      The snippits also seem to show use of the old API, accessing members that do not exist any longer.

      Tests I found:
      https://github.com/qt/qtdeclarative/blob/2dc1080f5f14c0b15a40e210d17a403c7490a18e/tests/manual/quickdialogs/dialogs/MessageDialogPage.qml
      https://github.com/qt/qtdeclarative/blob/ad02973c0599841bf792de494836b7d93bb4c50d/tests/auto/quickcontrols2/platform/data/tst_messagedialog.qml

        For Gerrit Dashboard: QTBUG-102865
        # Subject Branch Project Status CR V

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kkyzivat Keith Kyzivat
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes