列挙型のエントリが列挙型と一致する
この警告カテゴリは、qmllint では「[enum-entry-matches-enum] 」と表記されます。
列挙項目の名前は、列挙型自体とは異なる名前にする必要があります
何が起きたのか?
列挙型の名前が、そのエントリの1つと同じになっています。
なぜ問題なのでしょうか?
ルックアップの結果が何になるかについて曖昧さが生じる可能性があります。以下の例を参照してください。
例
// 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?
}この警告を解消するには、列挙型またはそのエントリのいずれかの名前を変更して、名前の競合を解消してください:
© 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.