Details
-
Task
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.13.2
-
None
-
Description
When I am calling console.log("Some text") from QML, something like this:
import QtQuick 2.12; import QtQuick.Window 2.12; Window { visible: true; width: 640; height: 480; title: qsTr("Hello World"); Component.onCompleted: { console.log("Some notice"); } }
Everything works fine, in log it's writing this:
qml: Some notice
But when I am calling the same console.log("Some notice"); from outside JS file (.pragma library),something like this:
.pragma library
function mTestFunction() {
console.log("Some notice");
}
import QtQuick 2.12; import QtQuick.Window 2.12; import "qrc:/test.js" as TEST; Window { visible: true; width: 640; height: 480; title: qsTr("Hello World"); Component.onCompleted: { TEST.mTestFunction(); } }
It's writing this:
qml: Some notice qml: undefined
The additional "qml: undefined" appearing only if calling console.log() from outside function.