- Qt 6.11
- Qt Qml
- Qt Qml Tooling
- qmllint
- QML Lint Warning and Errors
- Uncreatable type
- Qt 6.11.2 Reference Documentation

Top level component ◦ Unqualified

# 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 {}
     }

Top level component ◦ Unqualified