이 페이지에서

열거형 항목이 다른 열거형과 일치함

qmllint에서는 이 경고 범주를 ' [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
}

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