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
top-level-component.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 Top level component
8
\brief [top-level-component] Root QML type is a component.
9
10
\qmllintwarningcategory top-level-component
11
12
\section1 QML top level type can't be \e Component
13
14
\section2 What happened?
15
You used the \l [QML] {Component} type as top level type for your
16
QML file.
17
18
\section2 Why is this bad?
19
Your QML file already defines a component by itself. Using a \c Component type as
20
a top level type will wrap your component into another unnecessary component.
21
22
\section2 Example
23
\qml
24
import QtQuick
25
26
Component {
27
Item { ... }
28
}
29
\endqml
30
To fix this warning, remove the extra Component wrapping:
31
\qml
32
import QtQuick
33
34
Item { ... }
35
\endqml
36
*/
qtdeclarative
src
qml
doc
src
qmllint
top-level-component.qdoc
Generated on
for Qt by
1.16.1