Results 1 to 4 of 4

Thread: Qt start new application and quit

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Qt start new application and quit

    Hello! I posted my issue on stackoverflow: http://stackoverflow.com/questions/2...93521_27736976
    I have no idea how to run other application in background from main application. Every time main application is quitting, applications started by it are closed too.

    I have tried to use Q_DESTRUCTOR_FUNCTION to run process after main() is processing, without result. I also tried a lot of function:

    Qt Code:
    1. void closeApp()
    2. {
    3. QProcess test;
    4. if(test.startDetached("cmd.exe &"))
    5. qDebug() << "Running";
    6. QProcess::execute("cmd.exe");
    7. system("start cmd.exe &");
    8. system("cmd.exe &");
    9. execl("start cmd.exe", "ls", "-r", "-t", "-l", (char *) 0);
    10. system("cmd.exe");
    11. FILE* pd = popen("cmd.exe &", "r");
    12. }
    13.  
    14. Q_DESTRUCTOR_FUNCTION(closeApp)
    To copy to clipboard, switch view to plain text mode 

    Is it possible to launch and keep process by running from main application?
    edit: ok, the problem was debugger .. outside it all works great with simple QProcess::startDetached("xxx");
    Last edited by TheQuake; 3rd January 2015 at 23:39.

Similar Threads

  1. Correct way to quit a console application
    By c1223 in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2014, 19:51
  2. Replies: 2
    Last Post: 1st August 2011, 06:30
  3. Replies: 1
    Last Post: 28th July 2011, 09:10
  4. Application won't quit until event loop quits
    By caelestis in forum Qt Programming
    Replies: 6
    Last Post: 11th February 2010, 07:21
  5. Why my application quit?
    By yxtx1984 in forum Newbie
    Replies: 1
    Last Post: 7th February 2010, 05:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.