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
import-file-selector.qdoc
Go to the documentation of this file.
1// Copyright (C) 2026 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 Import file selector
8\brief [import-file-selector] Imports using file selectors.
9
10\qmllintwarningcategory import-file-selector
11
12This category is disabled by default due to current limitations in QML tooling towards
13QML modules with file selectors.
14
15\section1 Warnings occurred while importing
16
17\section2 What happened?
18The QML tooling found ambiguous types in an \l{Import Statements}{imported module}
19due to \l{Using File Selectors with Qt Quick Controls}{file selector} usages in the
20imported module. The QML runtime selects the appropriate file based on a runtime
21configuration, while the QML tooling has no information on which file will be
22selected, creating the ambiguity.
23
24
25\section2 Why is that bad?
26QML tooling can't use the import: the \l{Qt Quick Compiler}{compiler} can't compile
27this file to C++ and \l{qmllint} as well as \l{\QMLLS} can't provide useful warnings
28on that file.
29
30\omit
31// TODO: add example once there is a way to make tooling understand file selectors
32\section2 Example
33\qml
34// Main.qml
35import QtQuick
36
37Item {
38}
39\endqml
40To fix this warning, ...
41
42\qml
43import QtQuick
44
45Item {
46}
47\endqml
48
49\endomit
50*/