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. A single instance application that can restart itself
Forum Updated to NodeBB v4.3 + New Features

A single instance application that can restart itself

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.0k 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.
  • Z Offline
    Z Offline
    Zingam
    wrote on last edited by
    #1

    I used this:
    "http://developer.nokia.com/community/wiki/Run_only_one_instance_of_a_Qt_application
    ":http://developer.nokia.com/community/wiki/Run_only_one_instance_of_a_Qt_application to implement a singleton application pattern for my application and this:
    "http://qt-project.org/forums/viewthread/6293":http://qt-project.org/forums/viewthread/6293
    to make the application restart itself.

    Or in short I use QLocalSocket to implement the single application instance functionality and:
    @
    QProcess::startDetached(QApplication::applicationFilePath());
    exit(12);
    @

    On my first run the this seems to work fine but I am concerned that eventually the new instance could run before the old instance was shutdown.
    Is there a better way to do it or this is the only way?

    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