作成不可能なタイプ

この警告カテゴリーはqmllintによって[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.