Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.4.1
-
None
Description
There is some strangeness when using qsTr:
import QtQuick Window { id: root width: 640 height: 480 visible: true title: qsTr("Title") property var columnModel: [ { name: "Name", }, { name: qsTr("Name"), }, ] property var columnModelToo: [ { name: qsTr("Name"), }, { name: "Name", }, ] Text { text: qsTr("Status: %1").arg("hungry") } }
First issue is that using it with arg leads to a:
Error: main.qml:29:15: Could not compile binding for text: Cannot generate efficient code for call to untyped JavaScript function text: qsTr("Status: %1").arg("hungry") ^^^^
.
Second issue is with lists for models, where the order of qsTr calls leads either to
Error: main.qml:10:31: Could not compile binding for columnModel: Cannot generate efficient code for DefineObjectLiteral property var columnModel: [ ^
or to
Error: main.qml:21:19: Could not compile binding for columnModelToo: Cannot generate efficient code for call to untyped JavaScript function name: qsTr("Name"), ^^^^
.
The first issue doesn't seem to pop up in dev.