- Qt 6.11
- Qt Qml
- QML Lint Warning and Errors
- Duplicate inline components
- Qt 6.11.0 Reference Documentation

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