누락된 열거형 항목

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

열거형 항목이 아닙니다.

무슨 일이 있었나요?

존재하지 않는 열거형 값을 사용했습니다.

이것이 왜 나쁜가요?

열거형 값은 런타임에 정의되지 않습니다.

예시

// Main.qml
import QtQuick

Item {
    enum Hello { World }

    Component.onCompleted: function() {
        console.log(Main.Hello.Wordl, Main.Hello.Moon) // both Wordl and Moon are incorrect
    }
}

이 경고를 수정하려면 잠재적인 오타를 수정하거나 누락된 열거형 값을 정의에 추가하세요:

// Main.qml
import QtQuick

Item {
    enum Hello { World, Moon }

    Component.onCompleted: function() {
        console.log(Main.Hello.World, Main.Hello.Moon) // both correct now
    }
}

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