Closed Honghe closed 2 years ago
Env:
Use the qml following https://github.com/qmlbook/qt6book/blob/75d3677770/docs/ch15-javascript/javascript.md
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle { Button { width: 200 height: 300 // property bool checked: false text: "Click to toggle" // JS function function doToggle() { checked = !checked } onTriggered: { // this is also JavaScript doToggle(); console.log('checked: ' + checked) } } } }
But compiled with error output:
QQmlApplicationEngine failed to load component qrc:/demo_qml_c/main.qml:22:11: Cannot assign to non-existent property "onTriggered"
Env:
Use the qml following https://github.com/qmlbook/qt6book/blob/75d3677770/docs/ch15-javascript/javascript.md
But compiled with error output: