Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.8.2, 6.9.0 Beta2
-
None
Description
I'm trying to follow https://www.qt.io/blog/compiling-qml-to-c-qtquick-controls-and-optional-imports by doing something like this (simplified, macoS only):
qt_add_qml_module(appuntitled URI untitled VERSION 1.0 IMPORTS QtQuick.Controls.macOS QML_FILES Main.qml Foo.qml )
The Foo component explicitly inherits the non-native Fusion Label by importing Fusion with a qualifier:
import QtQuick import QtQuick.Controls.Fusion as F F.Label { id: control topPadding: 0 bottomPadding: 0 leftPadding: 0 rightPadding: 0 background: Rectangle { color: "red" implicitHeight: 1 implicitWidth: 1 } }
Main.qml uses Foo:
import QtQuick Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Foo { id: foo } Text { text: `padding is ${foo.padding}` } }
However qmllint complains:
Starting: "/usr/local/Qt/Tools/CMake/CMake.app/Contents/bin/cmake" --build /Users/njeiseck/projects/untitled/build-qtc/Qt_6_8_2_for_macOS-Debug --target all all_qmllint all_aotstats [1/4 15.4/sec] cd /Users/njeiseck/projects/untitled && /usr/local/Qt/6.8.2/macos/bin/qmllint @/Users/njeiseck/projects/untitled/build-qtc/Qt_6_8_2_for_macOS-Debug/.rcc/qmllint/appuntitled.rsp Warning: /Users/njeiseck/projects/untitled/Foo.qml:6:1: Not allowed to override "background" because native styles cannot be customized: See https://doc-snapshots.qt.io/qt6-dev/qtquickcontrols-customize.html#customization-reference for more information. [Quick.controls-native-customize] F.Label { ^ [2/4 7.9/sec] Generating .rcc/qmlcache/module_appuntitled.aotstats [3/4 10.8/sec] Generating .rcc/qmlcache/all_aotstats.aotstats, .rcc/qmlcache/all_aotstats.txt Formatted AOT stats saved to "/Users/njeiseck/projects/untitled/build-qtc/Qt_6_8_2_for_macOS-Debug/.rcc/qmlcache/all_aotstats.txt" [4/4 14.0/sec] cd /Users/njeiseck/projects/untitled/build-qtc/Qt_6_8_2_for_macOS-Debug && /usr/local/Qt/Tools/CMake/CMake.app/Contents/bin/cmake -E cat /Users/njeiseck/projects/untitled/build-qtc/Qt_6_8_2_for_macOS-Debug/.rcc/qmlcache/all_aotstats.txt ############ AOT COMPILATION STATS ############ Module untitled(appuntitled): --File /Users/njeiseck/projects/untitled/Foo.qml No attempts at compiling a binding or function --File /Users/njeiseck/projects/untitled/Main.qml 1 of 1 (100%) bindings or functions compiled to Cpp successfully text: [Main.qml:14:11] result: Success duration: 1283us ############ AOT COMPILATION STATS SUMMARY ############ Module untitled(appuntitled): 1 of 1 (100%) bindings or functions compiled to Cpp successfully Total results: 1 of 1 (100%) bindings or functions compiled to Cpp successfully
Note the aot compilation stats, it actually works. Seems like qmllint is missing something.