Signal handler not called in qmlscene
-
wrote on 4 Sept 2021, 14:40 last edited by Ferenc 9 Apr 2021, 15:02
Hi all,
The following snippet uses PointHandler to track touch events. It is running normally on the target device (embedded device with touchscreen, executing Qt (C++) application), but calls only the direct signal handler testing on my laptop with qmlscene.
import QtQuick 2.12 Item { id: root Rectangle { anchors.fill: parent PointHandler { id: handler property alias position: handler.point.position onPositionChanged: function () { console.log("xxx") } } } Canvas { anchors.fill: parent Connections { target: handler function onPositionChanged() { console.log("yyy") } } } }
Running the code above with qmlscene and clicking into the window results in logging only 'xxx' rows:
$ qmlscene tmptest.qml qml: xxx qml: xxx qml: xxx [...]
Am I doing something wrong, or is it a bug?
Ubuntu 20.04
Package: libqt5qml5
Version: 5.12.8-0ubuntu1Package: qmlscene
Version: 5.12.8-0ubuntu1Thanks,
Ferenc -
Hi all,
The following snippet uses PointHandler to track touch events. It is running normally on the target device (embedded device with touchscreen, executing Qt (C++) application), but calls only the direct signal handler testing on my laptop with qmlscene.
import QtQuick 2.12 Item { id: root Rectangle { anchors.fill: parent PointHandler { id: handler property alias position: handler.point.position onPositionChanged: function () { console.log("xxx") } } } Canvas { anchors.fill: parent Connections { target: handler function onPositionChanged() { console.log("yyy") } } } }
Running the code above with qmlscene and clicking into the window results in logging only 'xxx' rows:
$ qmlscene tmptest.qml qml: xxx qml: xxx qml: xxx [...]
Am I doing something wrong, or is it a bug?
Ubuntu 20.04
Package: libqt5qml5
Version: 5.12.8-0ubuntu1Package: qmlscene
Version: 5.12.8-0ubuntu1Thanks,
Ferencwrote on 6 Sept 2021, 06:03 last edited by@Ferenc said in Signal handler not called in qmlscene:
Am I doing something wrong, or is it a bug?
Maybe I am wrong but guess
handler
is out of scope of theCanvas
. -
@Ferenc said in Signal handler not called in qmlscene:
Am I doing something wrong, or is it a bug?
Maybe I am wrong but guess
handler
is out of scope of theCanvas
.wrote on 8 Sept 2021, 20:40 last edited by@KroMignon It is in the same file, why would not be? And after all, it works correctly in a Qt application, so why it behaves differently in qmlscene?
1/3