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