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
unused-imports.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2023 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 Unused imports
8
\brief [unused-imports] Types of the imported module were not used.
9
10
\qmllintwarningcategory unused-imports
11
12
\section1 Unused import
13
14
\section2 What happened?
15
You used an \l{qtqml-syntax-imports.html}{import statement} to import a QML module,
16
but did not use any of its types.
17
18
\section2 Why is this bad?
19
The import statement states a dependency to a QML module which is actually not needed.
20
This affects the readability of the code and the performance of the
21
QML engine and tooling by making them process an unnecessary QML module.
22
23
\section2 Example
24
\qml
25
import QtQuick
26
import QtQuick.Controls
27
28
Item {}
29
30
\endqml
31
To fix this warning, remove the unused import:
32
\qml
33
import QtQuick
34
35
Item {}
36
37
\endqml
38
*/
qtdeclarative
src
qml
doc
src
qmllint
unused-imports.qdoc
Generated on
for Qt by
1.16.1