Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt for MCUs 2.5.1
Description
When there is a custom QML module which has functions and if those functions are called from the "main.qml" it ends up generating broken C++ code.
with build errors like:
<Path_to_Build_dir>build-qtmcu203-Qt_for_MCUs_2_5_Desktop_32bpp_MSVC-Debug\qmlproject\CMakeFiles\qtmcu203.dir\qtmcu203.cpp(64): error C2228: left of '.getLine' must have class/struct/union
<path_to_Build_dir>\build-qtmcu203-Qt_for_MCUs_2_5_Desktop_32bpp_MSVC-Debug\qmlproject\CMakeFiles\qtmcu203.dir\qtmcu203.cpp(64): note: type is 'CustomModule::CustomButton *'
<path_to_Build_dir>\build-qtmcu203-Qt_for_MCUs_2_5_Desktop_32bpp_MSVC-Debug\qmlproject\CMakeFiles\qtmcu203.dir\qtmcu203.cpp(64): note: did you intend to use '->' instead?
For example:
"printLines" is a function in "main.qml" and "printing" and "getLine" are functions in the custom module's custom QML Type (CustomButton in the attached example)
CustomButton.qml
****************
function printing(line : string)
function getLine(number : int) : string {...}
****************
Main.qml
****************
function printLines(source: CustomButton, target:CustomButton)
****************
When manually editing the generated C++ file to use '->' like suggested. It starts to work like intended.
Way to reproduce:
1) Try to build attached code with Qt for MCUs 2.5.
2) It fails with the aforementioned error.
3) Manually edit it to use '->' and compilation finishes correctly and app run without errors