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