- Qt 6.10
- Qt Qml
- QML Lint Warning and Errors
- Duplicate Imports
- Qt 6.10.1 Reference Documentation

# 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 {

     }