式の中でvoidを使用しないでください
この警告カテゴリーはqmllintによって[void]
。
void 式を使用しないでください
何が起こりましたか?
JavaScriptのvoid式が使われました。
なぜ悪いのですか?
void 式はほとんど冗長になり、戻り値を抑制することでコードのロジックを不明瞭にすることがあります。また、多くのコードスタイルでは、明白でなく読みにくいという理由で禁止されています。
例
import QtQuick Item { function undef() { return void 0 } function f() { return void someFunction() } }
この警告を修正するには、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.