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. [solved] Restart a Qt application
Forum Update on Monday, May 27th 2025

[solved] Restart a Qt application

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 11.9k 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.
  • D Offline
    D Offline
    d.oberkofler
    wrote on 26 May 2011, 09:57 last edited by
    #1

    What would be the proper way to restart a Qt application.
    After a fatal error the application should offer an option to restarting itself again and I was wondering how this should be done in Qt?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      luca
      wrote on 26 May 2011, 10:13 last edited by
      #2

      I actually use this:
      @
      void MyApp::restartApp()
      {
      QProcess::startDetached(QApplication::applicationFilePath());
      exit(12);
      }
      @

      1 Reply Last reply
      1
      • D Offline
        D Offline
        d.oberkofler
        wrote on 15 Jun 2011, 15:19 last edited by
        #3

        Thank you!
        This is exactly what I was looking for.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          balab
          wrote on 13 Jan 2012, 11:11 last edited by
          #4

          works perfectly.Cheers

          1 Reply Last reply
          0
          • S Offline
            S Offline
            strahlex
            wrote on 30 Oct 2013, 08:53 last edited by
            #5

            Try to inherit QQuickItem instead of QObject. It is the default for creating QML Objects with QtQuick 2

            Feel free to check out my website machinekoder.com
            and my pet projects Intellicute and QtQuickVcp

            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