diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativedebugjs/data')
-rw-r--r-- | tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js | 28 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml | 41 |
2 files changed, 69 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js new file mode 100644 index 0000000..f96f8e9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js @@ -0,0 +1,28 @@ +function function2InScript(a) +{ + logger("return function2InScript"); + root.result = a; +} + +function functionInScript(a, b) +{ + logger("enter functionInScript"); + var names = ["Clark Kent", "Peter Parker", "Bruce Wayne"]; + var aliases = ["Superman", "Spiderman", "Batman"]; + var details = { + category: "Superheroes", + names: names, + aliases: aliases + }; + function2InScript(a + b); + logger("return functionInScript"); + return details; +} + +function logger(msg) +{ + //console.log(msg); + return true; +} + +//DO NOT CHANGE CODE ABOVE THIS LINE diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml new file mode 100644 index 0000000..f062bb9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml @@ -0,0 +1,41 @@ +import QtQuick 1.0 +import "backtrace1.js" as Script + +Item { + id: root + + property int result:0 + + Component.onCompleted: + { + root.result = 10; + Script.functionInScript(4,5); + root.name = "nemo"; + Script.logger(root.simpleBinding); + } + + //DO NOT CHANGE CODE ABOVE + //ADD CODE FROM HERE + + property string name + property int simpleBinding: result + + VisualItemModel { + id: itemModel + Rectangle { height: 30; width: 80; color: "red" } + Rectangle { height: 30; width: 80; color: "green" } + Rectangle { height: 30; width: 80; color: "blue" } + } + + ListView { + anchors.fill: parent + model: itemModel + + Component.onCompleted: + { + Script.logger("List Loaded"); + } + } + +} + |