[Interest] Connecting output of an external process to a QML component
daniel.franca at gmail.com
Wed Dec 31 16:45:35 CET 2014
I'm trying to connect the output of an external process to a QML component.
The idea would be to have a QProcess instance being called in a singleton
C++ class, that connects the readyReadStandardOutput to a slot in the C++
class.... and this last one emits a signal that I can connect into QML
I'm instantiating the C++ class via setContextProperty, so it's a singleton
Then I start the process, and connect the signal/slot:
Here's the first problem... the slot is never being called.
The slot should be called and then emit another signal (that I could
connect to QML): http://pastebin.com/Zvj1Y11w
The other problem is that QML can't recognize this signal:
Giving me the error: *Cannot call method 'connect' of undefined*
and of course, the signal is defined: http://pastebin.com/rxsnQNke
Googling around all the examples I see are using the QMLRegisterType
instead, to connect signals/slots, should I move to this way? It's not
possible to connect with singleton/context objects?
Of course, if there's an easier way to show the standard output of another
process to a QML component I would love to know.
Happy new year
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest