Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Some future release
-
None
-
dcd17fa7b77cb6adfb8b21ea90c113915cab9bd5
Description
After commit
commit 4a665ff5da05860f5eb46e3982ef3d8163a6cf59
Author: Aaron Kennedy <aaron.kennedy@nokia.com>
Date: Fri Jan 15 14:26:53 2010 +1000Implement custom QML slot invokation logic
Previously QML was inefficiently forwarding the task of invoking
Qt slots to QScript. QML does not implement the more advanced
argument coercian of QScript and does not support method overloading.
These two features are only needed to support legacy C++ classes
(of which QML has none), and are not worth the perf cost to support.
I can't find way to connect QML signal at script block.
For example:
Item {
id: item
signal clicked
width: 100
height: 100
MouseRegion {
anchors.fill: parent
onClicked: item.clicked()
}
Component.onCompleted: { item.clicked.connect(test); }
Script {
function test() {
print("test");
}
}
}
I found this:
// Uncomment to use QtScript method call logic // QScriptValue sobj = scriptEngine->newQObject(obj); // return Value(scriptEngine, sobj.property(toString(name)));
and after uncommenting it works.