[Interest] Design idioms for QtCore applications

Till Oliver Knoll till.oliver.knoll at gmail.com
Sat Feb 9 15:13:36 CET 2013


Am 08.02.2013 um 17:27 schrieb "K. Frank" <kfrank29.c at gmail.com>:

> Hello Jason!
> 
> ...
> 
> Obviously, that would add a bit of a layer of complications, but as
> Thiago said, using console input is not "Qt-approved," so some
> level of complication is to be expected.

To give you some ideas you might run into trying to do a "blocking read on stdin":

  http://www.mail-archive.com/interest@qt-project.org/msg01940.html

Especially when it comes to "multi-platform".

I am not saying that it is not possible, but you will end up using native APIs. Qt being traditionaly a GUI framework does not provide a solution to "read stdin in a console application way".

In the end in my "split processes with different privileges in the context of a Mac Sandbox application"-learning project I used a QLocalSocket for IPC (initially I also thought that I could simply use QProcess' stdin/stdout for that, but see above). Despite the fact that my GUI application has no "network privilege" it still can write/read to/from a local socket.

The "network enabled process" is a simple QCoreApplication which listens on the local socket "forever" where it receives commands such as "send that JPEG data to an AppleTV", "Discover AppleTVs", "Quit" etc.


Cheers,
  Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130209/cd3b944f/attachment.html>


More information about the Interest mailing list