このページでは

紛らわしい表現文

この警告カテゴリーはqmllintによって[confusing-expression-statement]

式文には明らかな効果はありません

何が起こったのですか?

明らかな効果のない式文を使用しました。

なぜ悪いのでしょうか?

コードが読みにくくなり、混乱の原因になります。通常は、何らかの式の結果が無視されたことを示しています。

何の効果もないにもかかわらず、式文はバイトコードにコンパイルされ、実行時に評価される。

import QtQuick

Item {
    function add(a: int, b: int) : int {
        a + b
    }
}

この警告を修正するには、効果のない式を削除するか、式の結果を使用する。

import QtQuick

Item {
    function add(a: int, b: int) : int {
        return a + b
    }
}

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