このページでは

作成不可能な型

この警告カテゴリは、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 {}
}

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