Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.4.1
-
054f43023 (dev), b13e22f27 (dev), b230eeb32 (6.5), 2b7c81184 (6.5)
Description
Existing models that come from some hardware specification typically have some properties that are i.e. quint16. While it is no problem to have them at runtime, qmlsc complains about them like in the attached example:
Warning: main.qml:14:9: Could not compile function writeValues: Type Druggeljug of Druggeljug does not have a property myInt8 for writing [compiler] Druggeljug.myInt8 = 42 ^^^^^^^^^^ Warning: main.qml:27:32: Type "qint8" of property "myInt8" not found. This is likely due to a missing dependency entry or a type not being exposed declaratively. [unresolved-type] console.log(Druggeljug.myInt8) ^^^^^^ Warning: main.qml:27:32: Could not compile function readValues: Cannot load property myInt8 from Druggeljug of Druggeljug. [compiler] console.log(Druggeljug.myInt8) ^^^^^^ Warning: main.qml:40:20: Could not compile function showValues: type qint8 for argument 0 cannot be resolved [compiler] Druggeljug.showMyInt8(1337) ^^^^^^^^^^
Additionally, the compiler for 6.5-dev generates code that gcc does not want to compile for c3.qml:
[ 77%] Building CXX object CMakeFiles/appsandbox.dir/build/.rcc/qmlcache/appsandbox_c3_qml.cpp.o /home/prcs1076/tmp/sandbox/build/.rcc/qmlcache/appsandbox_c3_qml.cpp: In lambda function: /home/prcs1076/tmp/sandbox/build/.rcc/qmlcache/appsandbox_c3_qml.cpp:336:35: error: call of overloaded 'QJSPrimitiveValue(uint&)' is ambiguous 336 | r2_2 = QJSPrimitiveValue(retrieved).toString(); | ^ In file included from /home/prcs1076/Projekte/qt6-build/qtbase/include/QtQml/qjsprimitivevalue.h:1, from /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsmanagedvalue.h:8, from /home/prcs1076/Projekte/qt6-build/qtbase/include/QtQml/qjsmanagedvalue.h:1, from /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsengine.h:13, from /home/prcs1076/Projekte/qt6-build/qtbase/include/QtQml/qjsengine.h:1, from /home/prcs1076/tmp/sandbox/build/.rcc/qmlcache/appsandbox_c3_qml.cpp:9: /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:157:14: note: candidate: 'QJSPrimitiveValue::QJSPrimitiveValue(const QVariant&)' 157 | explicit QJSPrimitiveValue(const QVariant &variant) noexcept | ^~~~~~~~~~~~~~~~~ /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:127:26: note: candidate: 'constexpr QJSPrimitiveValue::QJSPrimitiveValue(double)' 127 | Q_IMPLICIT constexpr QJSPrimitiveValue(double value) noexcept : d(value) {} | ^~~~~~~~~~~~~~~~~ /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:126:26: note: candidate: 'constexpr QJSPrimitiveValue::QJSPrimitiveValue(int)' 126 | Q_IMPLICIT constexpr QJSPrimitiveValue(int value) noexcept : d(value) {} | ^~~~~~~~~~~~~~~~~ /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:125:26: note: candidate: 'constexpr QJSPrimitiveValue::QJSPrimitiveValue(bool)' 125 | Q_IMPLICIT constexpr QJSPrimitiveValue(bool value) noexcept : d(value) {} | ^~~~~~~~~~~~~~~~~ /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:22:7: note: candidate: 'constexpr QJSPrimitiveValue::QJSPrimitiveValue(const QJSPrimit iveValue&)' 22 | class QJSPrimitiveValue | ^~~~~~~~~~~~~~~~~ /home/prcs1076/Projekte/qt6/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:22:7: note: candidate: 'constexpr QJSPrimitiveValue::QJSPrimitiveValue(QJSPrimitiveVal ue&&)'
Interrestingly, it compiles main.qml (which contains that type, too) without that error.
Attachments
Issue Links
- duplicates
-
QTBUG-101634 Add builtin types for 8 and 16bit integers, as well as unsigned 32bit
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-109111 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
446404,17 | QmlCompiler: Fix wrapping of numbers in QJSPrimitiveValue | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
447126,11 | QJSEngine: Add QJSPrimitiveValue conversions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
449124,3 | QmlCompiler: Fix wrapping of numbers in QJSPrimitiveValue | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
449125,1 | QmlCompiler: Fix wrapping of numbers in QJSPrimitiveValue | 6.4.2 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
449126,1 | QmlCompiler: Fix wrapping of numbers in QJSPrimitiveValue | 6.4 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
449130,3 | QJSEngine: Add QJSPrimitiveValue conversions | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
449133,1 | QmlCompiler: Fix wrapping of numbers in QJSPrimitiveValue | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: ABANDONED | 0 | 0 |
458231,1 | WIP: Mark (u)short, (u)long, (u)longlong as numbers in builtins | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |