이 페이지에서

중복 enum 항목

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

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