qtqmlqt5qtquickextras

Can a QML DelayButton's flashing be programmatically turned off?


I have a DelayButton that I would like to stop flashing (after it's been pressed) when the operation triggered by the button is completed.

However, it appears that none of the properties DelayButton are writeable. Is there a way to stop the flashing, or must it always flash until the user presses the button again?


Solution

  • DelayButton is a subclass of the Button. The flashing state is actually linked to the checked property of the Button, so the button.checked = false will help.

    You can always look into the source code: http://code.qt.io/cgit/qt/qtquickcontrols.git/tree/src/extras/DelayButton.qml