enumエントリがenumにマッチする

この警告カテゴリーはqmllintによって[enum-entry-matches-enum]

enum エントリは enum 自体とは異なる名前にすべきです。

何が起こりましたか?

enumがそのエントリと同じ名前になっています。

なぜ悪いのですか?

以下の例を参照してください。

// Main.qml
import QtQuick

Item {
    enum E { A, B, C, D, E }
    property var v: Main.E // Does this refer to the enum or to its entry?
}

この警告を修正するには、enum または enum エントリの名前を変更することで名前の衝突を解決します:

// Main.qml
import QtQuick

Item {
    enum Enum { A, B, C, D, E }
    property var v: Main.E // v contains Enum.E. No more ambiguity is possible
}

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