열거형 항목이 열거형과 일치합니다.

이 경고 범주의 철자는 [enum-entry-matches-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?
}

이 경고를 해결하려면 열거형 또는 열거형 항목의 이름을 변경하여 이름 충돌을 해결하세요:

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