Results 1 to 12 of 12

Thread: How to restart an application

  1. #1
    Join Date
    May 2010
    Location
    Algeria
    Posts
    23
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to restart an application

    Hi;
    How to restart an application.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to restart an application

    What do you mean?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    Naami (20th May 2010)

  4. #3
    Join Date
    May 2010
    Location
    Algeria
    Posts
    23
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to restart an application

    Hi;
    I have Qt application and I need to restart their execution.
    Thanks;

  5. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to restart an application

    Create a script that waits till the current process finished, then start a new one.
    Run the script when you close your program

  6. The following user says thank you to tbscope for this useful post:

    Naami (19th May 2010)

  7. #5
    Join Date
    May 2010
    Location
    Algeria
    Posts
    23
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to restart an application

    Hi;
    Thanks;
    Resources allowed not free by this method!!

  8. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to restart an application

    No, you have to take care of your resources and memory allocations yourself. There's no magic "release all my memory and allocations for me" as it doesn't know what is in use.

  9. #7
    Join Date
    May 2010
    Location
    Algeria
    Posts
    23
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to restart an application

    Hi;
    I have an application that is based on plugins, after several uses, I just do not unload this plugin (QPluginLoader:: unload ()) which remains blocked.

  10. #8
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to restart an application

    Quote Originally Posted by muisei View Post
    Try this:
    Nice.
    Posted as answer here.

  11. #9
    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

  12. #10
    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

  13. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 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.


  14. #12
    Join Date
    Jun 2014
    Posts
    98
    Thanks
    43
    Thanked 4 Times in 4 Posts
    Platforms
    Windows

    Default Re: How to restart an application

    Quote Originally Posted by squidge View Post
    No, you have to take care of your resources and memory allocations yourself. There's no magic "release all my memory and allocations for me" as it doesn't know what is in use.
    Unless you are in PySide/PyQt.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.