Use Q_PROPERTY RESET more
Open, Needs TriagePublic

Description

Q_PROPERTY has this amazing feature of a RESET method which is called when you assign undefined to it from QML. It is underused even in Qt.

For instance, in QtQuick Layouts, properties like Layout.maximumHeight, Layout.preferredHeight, etc are documented as

Setting this value to -1 will reset the width back to its implicit […].

Instead, it should have a RESET method and assigning undefined will do that instead of magic numbers.

We should look through the properties and see which ones could use such a method.
I think usually it should be compatible to add them in the 5.x series as right now it will just yell at you when you assign undefined.

Related Objects

StatusAssignedTask
OpenNone
OpenNone
broulik created this task.Dec 13 2019, 9:53 AM
alex moved this task from Backlog to Metatasks on the KF6 board.May 5 2021, 5:37 PM