- Qt 6.12
- Qt Qml
- Qt Qml Tooling
- qmllint
- QML Lint Warning and Errors
- Duplicate inline components
- Qt 6.12.0 Reference Documentation

Duplicate Imports ◦ Duplicate bindings

# Duplicate inline components

This warning category is spelled `[duplicate-inline-component]` by qmllint.

## Duplicate inline component

### What happened?

Two inline components have the same name.

### Why is that bad?

One name refers to more than one type and causes an ambiguity. This will fail to compile.

### Example

     import QtQuick

     Item {
         component R : Rectangle { color: "red" }
         component R : Rectangle { color: "blue" } // Fail to compile
     }

To fix this warning, remove or rename one of the inline components:

     import QtQuick

     Item {
         component RedRectangle : Rectangle { color: "red" }
         component BlueRectangle : Rectangle { color: "blue" }
     }

Duplicate Imports ◦ Duplicate bindings