Results 1 to 12 of 12

Thread: How to restart an application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to restart an application

    Quote Originally Posted by muisei View Post
    Whenever you want to restart the application just call exit(RESTART_CODE) to exit the event loop with RESTART_CODE.
    Hi all,

    To repeat the loop I would rather call:
    Qt Code:
    1. qApp->exit(RESTART_CODE);
    To copy to clipboard, switch view to plain text mode 
    Or indifferently:
    Qt Code:
    1. QApplication::instance()->exit(RESTART_CODE);
    To copy to clipboard, switch view to plain text mode 

    Otherwise the program appears to be exited immediately.

    Cheers,

    Alexandre

  2. #2
    Join Date
    Dec 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How to restart an application

    Hi to all, here I am. I'm looking for a easy solution on how to restart an application, I read something, consider I'm a novice, if anyone has a working sample would be great...thanks in advance

    walter

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to restart an application

    Quote Originally Posted by walter.gallieni View Post
    Hi to all, here I am. I'm looking for a easy solution on how to restart an application, I read something, consider I'm a novice, if anyone has a working sample would be great...thanks in advance
    You might want to reformulate your question, currently it is very generic. At this moment I'd say that the easiest way to restart an application is to close it and start it up again the same way it was started originally.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Restart Application
    By d4rc in forum Newbie
    Replies: 8
    Last Post: 13th May 2010, 14:24
  2. how to restart the MainWindow?
    By d@nyal in forum Newbie
    Replies: 2
    Last Post: 3rd May 2010, 03:51
  3. QTime restart
    By jhowland in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2008, 20:18
  4. How to restart an application?
    By xylosper in forum Qt Programming
    Replies: 2
    Last Post: 12th August 2007, 13:04
  5. Restart QApplication
    By Svaths in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 8th February 2007, 11:54

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
  •  
Qt is a trademark of The Qt Company.