Uncreatable type

This warning category is spelled [uncreatable-type] by qmllint.

Namespace must start with an upper case letter

What happened?

You used a QML object from a lower-case namespace.

Why is this bad?

The QML language forbids lower-case namespaces.

Example

import QtQuick as quick

quick.Item { ... }

To fix the warning, rename the namespace to start with a capital letter:

import QtQuick as Quick

Quick.Item { ... }

Singleton type is not creatable

What happened?

You tried to instantiate a QML object from a singleton type.

Why is this bad?

The QML language forbids instantiations of singletons.

Example

import QtQuick

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

    property string someProperty: qt.uiLanguage
}

To fix the warning, use the singleton directly without instantiating it:

import QtQuick

Item {
    property string someProperty: Qt.uiLanguage
}

Type is not creatable

What happened?

You tried to instantiate a QML object from an uncreatable type.

Why is this bad?

Uncreatable types are specifically marked to forbid instantiations. You might be misusing a type that should only be used as an attached type or as an interface.

Example

Attached type misuse

import QtQuick

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

To fix the warning, use the Keys attached type instead of instantiating it:

import QtQuick

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

Interface misuse

import QtQuick

Item {
    property PointerHandler myHandler: PointerHandler {}
}

To fix the warning, use a more specific derived type like TapHandler:

import QtQuick

Item {
    property PointerHandler myHandler: TapHandler {}
}

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