Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "QProcess::startDetached" - child's console not showing up?
Qt 6.12 LTS is out! See what's new in the release blog

"QProcess::startDetached" - child's console not showing up?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GGodis
    wrote on last edited by GGodis
    #1

    Is it really a normal thing that a child process that is a "console application" (SubSystem:CONSOLE) will not show up it's console when launched using "QProcess::startDetached"?

    MS documentation regarding "AllocConsole" says:
    "Console applications are initialized with a console, unless they are created as detached processes (by calling the CreateProcess function with the DETACHED_PROCESS flag)."
    https://docs.microsoft.com/en-us/windows/console/allocconsole

    I'm a bit confused, because I've tested this with two different Qt versions:
    x86 - 5.7.0.0 - "QProcess::startDetached" - child process shows it's console.
    x64 - 5.10.0.0 - "QProcess::startDetached" - child process will not show it's console.
    (I'm migrating from 5.7 to 5.10 and was really surprised not to see the console)

    I'm suspecting that this was cause by the Qt bugfix: https://bugreports.qt.io/browse/QTBUG-53833

    In my child process (debug) I've ended up with:

    1. Allways using "SubSystem:WINDOWS"
    2. Creating the console by using "AllocConsole()". (I'f you're using "SubSystem:CONSOLE" be sure to call "FreeConsole()" before calling "AllocConsole()")
    3. Capturing output with: "freopen("CONOUT$", "w", stderr);" and "freopen("CONOUT$", "w", stdout);"
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the looks of it, you need to use the new version of startDetached using CreateProcessArgumentModifier.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved