Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
duplicate-import.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\ingroup qmllint-warnings-and-errors
6
7
\title Duplicate Imports
8
\brief [duplicate-import] Duplicate import.
9
10
\qmllintwarningcategory duplicate-import
11
12
\section1 Duplicate import
13
14
\section2 What happened?
15
The document contains duplicate import statements.
16
17
\section2 Why is that bad?
18
They pollute the document unnecessarily and may slow down startup of the app.
19
20
\section2 Example
21
22
\qml
23
import QtQuick.Controls
24
import QtQuick
25
import QtQuick 2.1 as QQ21
26
import QtQuick.Controls
27
28
Item {
29
30
}
31
\endqml
32
To fix this warning, remove all but the last duplicated import. Be careful to
33
not change the order of imports, as it can affect type resolution:
34
\qml
35
import QtQuick
36
import QtQuick 2.1 as QQ21 // different from the previous import
37
import QtQuick.Controls
38
39
Item {
40
41
}
42
\endqml
43
*/
qtdeclarative
src
qml
doc
src
qmllint
duplicate-import.qdoc
Generated on
for Qt by
1.16.1