Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Launching of process on mac using Qt
QtWS25 Last Chance

Launching of process on mac using Qt

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.2k Views
  • 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.
  • P Offline
    P Offline
    prasanna.c3
    wrote on last edited by
    #1

    i am working on sample applications using QT on Mac and i found out problem with one of its API. I want to run process so i am using following function

    QProcess::startDetached();

    And i am passing program(location of exe )and argument list as parameter now problem is that if the application is allready running then the this will create another process and runs it where as when i cross cheked with Windows its behavior is different in the sense that it does not start application which is allready running. can anyone help me how to fix the issue??

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi there,
      When you call the QProcess::startDetached() you will not have a QProcess identifier (member variable) so your program is unaware of any already running programs. That shouldn't be any different between Mac and Win.
      What the difference might be is the startup sequence of the process started. Maybe it checks if it is already running and doesn't start again. If the programmer made an error there the difference between Mac and Win is explainable.
      A solution otherwise is to keep a member variable of QProcess and when the program needs to be started again check if the program is still running. You get a signal if anything happens with the QProgress that you already started. If you want to close your application, but keep the other program active, just exit the program and the program should keep on going. If you want to close it, you simple call qproc.close();
      Hope this helps!

      Greetz, Jeroen

      1 Reply Last reply
      0

      • Login

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