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 start new instance
Qt 6.12 LTS is out! See what's new in the release blog

QProcess start new instance

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 747 Views 1 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by SPlatten
    #1

    I launch a new process using QProcess:

    QProcess* pobjProc(new QProcess());
    pobjProc->start(strModule);
    if ( !pobjProc->waitForStarted() ) {
        delete pobjProc;
        return;
    }
    const Q_PID cpid(pobjProc->pid());
    mmpProcesses.insert(cpid, pobjProc);
    

    For testing I'm using gedit as the module to launch, the problem I'm seeing is that I want to be able to launch multiple instances and calling this again doesn't, it does re-focuses the already running instance of gedit.

    Do I need to add something to indicate new instance intended? This is using Qt 4.8

    [Edit] I've also tried the using startDetached same result, only one instance is launched.

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This is a behavior of your app you're starting - look for a command line argument to allow more than one instance of this application.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      SPlattenS 1 Reply Last reply
      4
      • Christian EhrlicherC Christian Ehrlicher

        This is a behavior of your app you're starting - look for a command line argument to allow more than one instance of this application.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        @Christian-Ehrlicher , typical, I picked this application at random just to test and it does indeed have an argument --new-window to launch a new instance.

        Kind Regards,
        Sy

        1 Reply Last reply
        2

        • Login

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