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