Shadowable member
This warning category is spelled [shadowable-member] by qmllint.
Member can be shadowed
What happened?
The compiler accesses a non-final property or method through an object whose exact type isn't known at compile time. A derived type might redeclare ("shadow") the member with a different type, and the QML engine would pick up that variant.
In the example below, the lookup for value on other can't be fully optimized because other might hold an object of a type deriving from Base that shadows value with a property of another type.
Why is that bad?
The compiler can't rely on the declared type of the member and has to treat it as var. The generated code is slower.
This category is enabled automatically if the compiler category is enabled, unless it is explicitly enabled or disabled.
Example
Marking value as final guarantees that it can't be shadowed and allows the compiler to rely on the type it sees. In QML, use the final keyword:
In C++, declare the property FINAL:
Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged FINAL)Alternatively, access the member through an object referenced by id, an attached property or a singleton, where the exact type is known.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.