[Interest] Qt5.8 doesnot show consolewindow on windows os

Günter Michel gm at mes-ia.de
Thu Jan 26 19:51:16 CET 2017


Am 26.01.2017 um 13:46 schrieb Björn Piltz:
> https://bugreports.qt.io/browse/QTBUG-57687
>
> 2017-01-26 13:45 GMT+01:00 Björn Piltz <bjornpiltz at gmail.com 
> <mailto:bjornpiltz at gmail.com>>:
>
>     Seems to be because of this:
>     http://code.qt.io/cgit/qt/qtbase.git/commit/src/corelib/io/qprocess_win.cpp?id=bec2fc19fd18768b16925597871c77a61e716abd
>     <http://code.qt.io/cgit/qt/qtbase.git/commit/src/corelib/io/qprocess_win.cpp?id=bec2fc19fd18768b16925597871c77a61e716abd>
>
>
>
>
>     2017-01-26 12:00 GMT+01:00 Günter Michel <gm at mes-ia.de
>     <mailto:gm at mes-ia.de>>:
>     >
>     > In Qt5.7 starting a detached console works fine.
>     >
>     > void MainWindow::start()
>     >
>     > {
>     >
>     >     QProcess p;
>     >
>     >     QStringList args;
>     >
>     >     args << "/k";
>     >
>     >     p.startDetached("cmd", args);
>     >
>     > }
>     >
>     > In Qt5.8 Process 'cmd /k' is started, but no console window is
>     shown.
>     >
>     > Any suggestions?
>     >
>     >
>     >
>     > _______________________________________________
>     > Interest mailing list
>     > Interest at qt-project.org <mailto:Interest at qt-project.org>
>     > http://lists.qt-project.org/mailman/listinfo/interest
>     <http://lists.qt-project.org/mailman/listinfo/interest>
>     >
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
To restore the 5.7 behaviour i tried to do this like the documentation 
suggests

p.setCreateProcessArgumentsModifier([](QProcess::CreateProcessArguments*args) 


{

args->flags|=CREATE_NEW_CONSOLE;

args->startupInfo->dwFlags&=~STARTF_USESTDHANDLES;

args->startupInfo->dwFlags|=STARTF_USEFILLATTRIBUTE;

args->startupInfo->dwFillAttribute=BACKGROUND_BLUE|FOREGROUND_RED

|FOREGROUND_INTENSITY;

});

but the function won't be called.

-- 
MES Industrieautomation GmbH
Simmershäuser Straße 102D
D-34125 Kassel

Tel.  0049(0561) 813004
Fax   0049(0561) 813005
Mobil +49 172 9822485
E-mail: gm at mes-ia.de
http:// www.mes at mes-ia.de

Registergericht: Amtsgericht Kassel HRB5618

Geschäftsführer: Ralf Brüne
                  Günter Michel
                  Axel Rosenthal
                  Manfred Stangl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170126/77ac628e/attachment.html>


More information about the Interest mailing list