Well, I tried using the signal/slot method... but without any luck.
In my functions.js I have:
var graphNotifier = Qt.createQmlObject('import QtQuick 2.0; QtObject { signal graphDataChanged }', Qt.application, 'GraphNotifier');
var graphNotifier = Qt.createQmlObject('import QtQuick 2.0; QtObject { signal graphDataChanged }', Qt.application, 'GraphNotifier');
To copy to clipboard, switch view to plain text mode
and in my GraphWin.qml (which imports functions.js), I have:
Component.onCompleted: {
loadGraphs();
Funcs.graphNotifier.graphDataChanged.connect(loadGraphs);
console.log("loaded: graphWin");
}
Component.onCompleted: {
loadGraphs();
Funcs.graphNotifier.graphDataChanged.connect(loadGraphs);
console.log("loaded: graphWin");
}
To copy to clipboard, switch view to plain text mode
Where "loadGraphs()" is a function in javascript that populates the QML XYSeries with the correct (live) data. Calling loadGraphs() works, I get my data... no issues there.
I call/fire the signal in javascript like so:
graphNotifier.graphDataChanged();
graphNotifier.graphDataChanged();
To copy to clipboard, switch view to plain text mode
once I receive new data... However, the signal does not fire... loadGraphs() does not get called.
Any idea why?
Bookmarks