[Qt-interest] stdout of MSWin GUI application run from console

Jason H scorp1us at yahoo.com
Wed Apr 13 17:02:32 CEST 2011


Not possible. You could look up the process tree and find out that cmd.exe 
launched you, but that's about it.
I'd go beyond the console though, and allow a command line parameter to provide 
a window that is nothing more than a TextEdit. 

This way the user can easily copy, paste, and for the love of {deity} resize the 
window, move it etc.






----- Original Message ----
From: Paul Miller <paul at fxtech.com>
To: qt-interest at qt.nokia.com
Sent: Wed, April 13, 2011 10:54:40 AM
Subject: Re: [Qt-interest] stdout of MSWin GUI application run from console

On 4/13/2011 9:40 AM, Felipe Magno de Almeida wrote:
> On Wed, Apr 13, 2011 at 9:24 AM, Graeme Gill<graeme2 at argyllcms.com>  wrote:
>> Thiago Macieira wrote:
>>> CONFIG += console
>>
>> Hi,
>>         no that's not the same at all. It looks the same
>> when run from the command line, but then pops a console
>> window when run from the GUI (explorer).
>>
>> The approach I suggested doesn't pop up a console
>> when invoked from the GUI, behaving instead like
>> applications does on Linux/X11. (Try it for
>> yourself.)
>
> Why do you think the Linux behavior is better on Windows? All other
> Windows applications do the "Windows-way". If your application
> is a console application, then it opens a console if not ran from one
> or if it is not a console application then it doesn't use one at all. This
> is how Windows users are accostumed. QT is not supposed to be
> a on-size-fits-all solution, but it also tries to be as native to the
> platform as possible. If you need this behavior then you should
> use the code you just posted. But this shouldn't be imposed on
> all other users.

This was my point. I only want the console output when the app is run 
from a console. When run from the GUI, I don't want the console popping 
up. I haven't been able to find a reliable way to make a Qt app on 
Windows that behaves like a console app when run from the console (ie. 
prints stuff to the console), and a GUI app when run from Explorer.
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest



      



More information about the Qt-interest-old mailing list