Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0, 6.1, 6.2, 6.3
-
None
-
-
df36473e94 (qt/qtdeclarative/dev) df36473e94 (qt/tqtc-qtdeclarative/dev)
Description
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
Attachments
For Gerrit Dashboard: QTBUG-102865 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
410371,4 | QQuickMessageDialog: improve the documentation for buttonClicked() | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |