Do not use void in expressions
This warning category is spelled [void]
by qmllint.
Do not use void expressions
What happened?
A JavaScript void expression was used.
Why is this bad?
The void expression has become mostly redundant and can obscure the logic of some code by suppressing returned values. It is also prohibited in many code styles for being non-obvious and hard to read.
Example
import QtQuick Item { function undef() { return void 0 } function f() { return void someFunction() } }
To fix this warning, remove or replace the use of void:
import QtQuick Item { function undef() { return undefined } function f() { somefunction() } }
© 2025 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.