Duplicate Imports | Qt Qml | Qt 6.11.2
Description: [duplicate-import] Duplicate import.

- Qt 6.11
- Qt Qml
- Qt Qml Tooling
- qmllint
- QML Lint Warning and Errors
- Duplicate Imports
- Qt 6.11.2 Reference Documentation

Duplicate enum entries ◦ Duplicate inline components

# Duplicate Imports

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

## Duplicate import

### What happened?

The document contains duplicate import statements.

### Why is that bad?

They pollute the document unnecessarily and may slow down startup of the app.

### Example

     import QtQuick.Controls
     import QtQuick
     import QtQuick 2.1 as QQ21
     import QtQuick.Controls

     Item {

     }

To fix this warning, remove all but the last duplicated import. Be careful to not change the order of imports, as it can affect type resolution:

     import QtQuick
     import QtQuick 2.1 as QQ21 // different from the previous import
     import QtQuick.Controls

     Item {

     }

Duplicate enum entries ◦ Duplicate inline components