Reset a QML property from Javascript
-
wrote on 1 Jan 2022, 05:29 last edited by EddieC 1 Jan 2022, 05:29
Is there a way to reset a property in QML from Javascript? Apparently the way to reset a property in QML is to assign undefined to it, but attempting to do it from Javascript is resulting in type errors ("can't assign undefined to int", "can't assign undefined to double"). I've also tried null with the same results.
-
wrote on 1 Jan 2022, 15:34 last edited by
@EddieC said in Reset a QML property from Javascript:
reset a property in QML
https://doc.qt.io/archives/qt-5.9/qml-qtquick-propertychanges.html
-
@EddieC said in Reset a QML property from Javascript:
reset a property in QML
https://doc.qt.io/archives/qt-5.9/qml-qtquick-propertychanges.html
wrote on 14 Jan 2022, 23:28 last edited by@Markkyboy said in Reset a QML property from Javascript:
https://doc.qt.io/archives/qt-5.9/qml-qtquick-propertychanges.html
So, the only way would be to create a dummy state with the PropertyChange and to activate the state? No way to act directly on the property?
-
Is there a way to reset a property in QML from Javascript? Apparently the way to reset a property in QML is to assign undefined to it, but attempting to do it from Javascript is resulting in type errors ("can't assign undefined to int", "can't assign undefined to double"). I've also tried null with the same results.
@EddieC
on what properties did you try it exactly?
maybe the property does not have a reset method defined?