열거형 항목 중복

이 경고 범주의 철자는 [duplicate-enum-entries] 입니다.

열거형 키 X가 이미 선언되었습니다.

무슨 일인가요?

열거형에 두 개의 동일한 항목이 포함되어 있습니다.

이것이 왜 나쁜가요?

동일한 키가 여러 값과 연관되어 있습니다. 어떤 값이 사용될지 명확하지 않습니다.

예시

import QtQuick

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

이 경고를 해결하려면 중복된 열거형 항목을 제거하거나 이름을 바꾸세요:

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.