MessageDialog has no states: property?
Unsolved
QML and Qt Quick
-
MessageDialog has no states: property
That's because dialogs don't inherit from
Item
. But you can make your own dialog that extendsMessageDialog
. You can then add your own states property with StateGroup QML Type. -
@Wieland I have tried what you said and I am having this error: Cannot assign to non-existent default property at line StateGroup.
This is my code:MessageDialog { id: msgDialog icon: StandardIcon.Warning; standardButtons: StandardButton.Ok StateGroup { id: msgDialogStates states: [ State { name: "ActionsDialog" PropertyChanges { target: msgDialog title: qsTr("Actions Error") text: qsTr("Message.") } }, State { name: "PropertiesDialog" PropertyChanges { target: msgDialog title: qsTr("Properties Error"); text: qsTr("Another.") } } ] } }
The lines with the properties: title, text, icon and standardButtons are in red as I mencioned in another post.