이 페이지에서

누락된 열거형 항목

qmllint에서는 이 경고 범주를 ‘ [missing-enum-entry] ’로 표기합니다.

enum의 항목이 아닙니다

무슨 일이 있었나요?

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

왜 문제가 될까요?

런타임 시 해당 열거형 값은 정의되지 않은 상태가 됩니다.

예시

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

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