생성할 수 없는 유형

이 경고 카테고리의 철자는 [uncreatable-type] 입니다.

네임스페이스는 대문자로 시작해야 합니다.

무슨 일이 있었나요?

소문자 네임스페이스의 QML 개체를 사용했습니다.

이것이 왜 나쁜가요?

QML 언어에서는 소문자 네임스페이스를 금지합니다.

예제

import QtQuick as quick

quick.Item { ... }

경고를 해결하려면 네임스페이스 이름을 대문자로 시작하도록 바꾸세요:

import QtQuick as Quick

Quick.Item { ... }

싱글톤 유형을 만들 수 없습니다.

무슨 일이 있었나요?

싱글톤 유형에서 QML 개체를 인스턴스화하려고 했습니다.

이것이 왜 나쁜가요?

QML 언어에서는 싱글톤의 인스턴스화를 금지하고 있습니다.

예제

import QtQuick

Item {
    Qt { // note: Qt is a singleton type
        id: qt
    }

    property string someProperty: qt.uiLanguage
}

경고를 해결하려면 싱글톤을 인스턴스화하지 않고 직접 사용하세요:

import QtQuick

Item {
    property string someProperty: Qt.uiLanguage
}

유형을 만들 수 없습니다.

무슨 일이 있었나요?

uncreatable type 에서 QML 개체를 인스턴스화하려고 했습니다.

이것이 왜 나쁜가요?

생성할 수 없는 유형은 인스턴스화를 금지하도록 특별히 표시되어 있습니다. 첨부된 유형이나 인터페이스로만 사용해야 하는 유형을 잘못 사용하고 있을 수 있습니다.

예시

첨부된 유형 오용

import QtQuick

Item {
    Keys {
        onPressed: function (key) { ... }
    }
}

경고를 수정하려면 인스턴스화하는 대신 Keys 첨부 유형을 사용하세요:

import QtQuick

Item {
    Keys.onPressed: function (key) { ... }
}

인터페이스 오용

import QtQuick

Item {
    property PointerHandler myHandler: PointerHandler {}
}

경고를 수정하려면 TapHandler 와 같은 보다 구체적인 파생 유형을 사용하세요:

import QtQuick

Item {
    property PointerHandler myHandler: TapHandler {}
}

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