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
\page qmllint-warnings-and-errors-duplicate-import.html
6
\ingroup qmllint-warnings-and-errors
7
8
\title Duplicate Imports
9
\brief [duplicate-import] Duplicate import.
10
11
\qmllintwarningcategory duplicate-import
12
13
\section1 Duplicate import
14
15
\section2 What happened?
16
The document contains duplicate import statements.
17
18
\section2 Why is that bad?
19
They pollute the document unnecessarily and may slow down startup of the app.
20
21
\section2 Example
22
23
\qml
24
import QtQuick.Controls
25
import QtQuick
26
import QtQuick 2.1 as QQ21
27
import QtQuick.Controls
28
29
Item {
30
31
}
32
\endqml
33
To fix this warning, remove all but the last duplicated import. Be careful to
34
not change the order of imports, as it can affect type resolution:
35
\qml
36
import QtQuick
37
import QtQuick 2.1 as QQ21 // different from the previous import
38
import QtQuick.Controls
39
40
Item {
41
42
}
43
\endqml
44
*/
qtdeclarative
src
qml
doc
src
qmllint
duplicate-import.qdoc
Generated on
for Qt by
1.14.0