4 import "functionAssignment.js" as Script
8 property int aNumber: 10
10 property bool assignToProperty: false
11 property bool assignToPropertyFromJsFile: false
13 property bool assignWithThis: false
14 property bool assignWithThisFromJsFile: false
16 property bool assignToValueType: false
18 property bool assignFuncWithoutReturn: false
19 property bool assignWrongType: false
20 property bool assignWrongTypeToValueType: false
23 onAssignToPropertyChanged: {
24 function myFunction() {
30 property QtObject obj: QtObject {
31 property int aNumber: 4212
32 function myFunction() {
33 return this.aNumber * 10; // should use the aNumber from root, not this object
36 onAssignWithThisChanged: {
40 onAssignToPropertyFromJsFileChanged: {
41 Script.bindPropertyWithThis()
44 onAssignWithThisFromJsFileChanged: {
48 property Text text: Text { }
49 onAssignToValueTypeChanged: {
50 text.font.pixelSize = (function() { return aNumber * 10; })
51 a = (function() { return text.font.pixelSize; })
57 onAssignFuncWithoutReturnChanged: {
58 function myFunction() {
63 onAssignWrongTypeChanged: {
64 function myFunction() {
70 onAssignWrongTypeToValueTypeChanged: {
71 text.font.pixelSize = (function() { return 'a string'; })