enumエントリの重複

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

列挙キー X はすでに宣言されています。

何が起こったのですか?

enumに2つの同じエントリが含まれています。

なぜ悪いのですか?

同じキーが複数の値に関連付けられています。どれが使われるのかが明確ではありません。

import QtQuick

Item {
    enum E { A = 0, B = 1, C = 2, A = 3 }
}

この警告を修正するには、重複する enum エントリを削除するか、名前を変更してください:

import QtQuick

Item {
    enum E { A = 0, B = 1, C = 2, D = 3 }
}

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