コンマ

この警告カテゴリのスペルは[comma] です。

カンマ表現は使用しないでください。

何が起こったのですか?

JavaScriptのカンマ式がforループの外で使われました。

これはなぜ悪いのでしょうか?

カンマ式はコードの可読性を低下させ、副作用を不明瞭にします。

import QtQuick

Item {
    Component.onCompleted: init(config, true), enableLogging(categories), run(1000) // millis
}

この警告を修正するには、コードをリファクタリングして、各操作に個別のステートメントを使用するようにします。こうすることで、無関係な操作の一部として起こるのではなく、それぞれの副作用が明示されます:

import QtQuick

Item {
    Component.onCompleted: {
        init(config, true)
        enableLogging(categories)
        run(1000) // millis
    }
}

© 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.