Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.2.1, 5.5.0
-
Windows 7, OS X 10.9.5
Description
Test attached sample application. See that on Qt 5.1.1 Qt.Binding works fine but later releases it returns error:
TypeError: Cannot call method 'invokableMethod' of undefined
Bug is produced if the pointer used in Qt.Binding is c++ signal attribute. If pointer is set to local JS variable then it works. See from the sample code that aItem is signal attribute that fails. If it's set to bItem variable then Qt.Binding works.
// WORKAROUND is to set aItem to helper variable // var bItem = aItem var object = component.createObject(mainWindow, { "someint" : Qt.binding(function() { return aItem.invokableMethod(someVariable) }) // WORKAROUND to read from helper variable // "someint" : Qt.binding(function() { return bItem.invokableMethod(someVariable) }) })
It should work without the hack like it works in Qt 5.1.1.