[Interest] Design idioms for QtCore applications
K. Frank
kfrank29.c at gmail.com
Sat Feb 9 17:51:05 CET 2013
Hi Oliver!
On Sat, Feb 9, 2013 at 9:13 AM, Till Oliver Knoll
<till.oliver.knoll at gmail.com> wrote:
> 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
Yes, I remember that thread to some extent.
>
> 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.
Thanks. This also reminds me of issues I hadn't been considering,
namely various cross-platform concerns (e.g., your mac stuff).
>
> Cheers,
> Oliver
Thanks for the pointers.
K. Frank
More information about the Interest
mailing list