Duplicate inline components | Qt Qml | Qt 6.11.1
Description: [duplicate-inline-components] Duplicate inline component.

- Qt 6.11
- Qt Qml
- Qt Qml Tooling
- qmllint
- QML Lint Warning and Errors
- Duplicate inline components
- Qt 6.11.1 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