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

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