[Interest] Connecting output of an external process to a QML component

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Wed Dec 31 17:24:34 CET 2014


as per recognition of signal on the QML side, try making the first letter
non-capitalized, i.e. call it executionFinished instead of
ExecutionFinished. I guess that should help.

If you don't see qDebug's output inside the readyToRead() slot, then it
should be your first point of attention. So the problem, most probably, is
on the C++ side.

Other stuff seems okay to me.


On Wed, Dec 31, 2014 at 6:45 PM, Daniel Fran├ža <daniel.franca at gmail.com>

> Hi guys,
> 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 object.
> Then I start the process, and connect the signal/slot:
> http://pastebin.com/p2CyZwfh
> 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:
> http://pastebin.com/QWkkk5mT
> 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
> Best,
> Daniel
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141231/ee5dbfc5/attachment.html>

More information about the Interest mailing list