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. QtSingleApplication No such file or directory [SOLVED]

QtSingleApplication No such file or directory [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
qt5qtsingleapplica
11 Posts 3 Posters 4.3k 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.
  • R Offline
    R Offline
    Robey Mardon
    wrote on 4 May 2015, 18:28 last edited by Robey Mardon 5 Apr 2015, 18:38
    #1

    I tried to include QtSingleApplication and I got this error: No such file or directory.

    #include <QtSingleApplication>
    

    .pro:

    QT += core gui widgets
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on 4 May 2015, 18:31 last edited by
      #2

      HI and welcome to devnet,

      QtSingleApplication is not part of Qt

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      R 1 Reply Last reply 4 May 2015, 18:36
      1
      • M mcosta
        4 May 2015, 18:31

        HI and welcome to devnet,

        QtSingleApplication is not part of Qt

        R Offline
        R Offline
        Robey Mardon
        wrote on 4 May 2015, 18:36 last edited by Robey Mardon 5 Apr 2015, 18:37
        #3

        @mcosta Thanks, I just realized that. I think that I need to create another one using QLocalServer and QLocalSocket.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on 4 May 2015, 19:10 last edited by
          #4

          HI,

          if you need to run a single instance of your app you could also use some hidden system file created from you app and deleted when it exit

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          R 1 Reply Last reply 4 May 2015, 20:04
          0
          • M mcosta
            4 May 2015, 19:10

            HI,

            if you need to run a single instance of your app you could also use some hidden system file created from you app and deleted when it exit

            R Offline
            R Offline
            Robey Mardon
            wrote on 4 May 2015, 20:04 last edited by Robey Mardon 5 Apr 2015, 20:08
            #5

            @mcosta I can't because I want the running instance to receive commands/messages for real-time interaction.
            I just created a class that inherits from QApplication and created the QLocalServer there, my only problem though is to raise/activate/focus/bring to front the window, it doesn't work properly on Windows system.

            window->setWindowState(window->windowState() & ~Qt::WindowMinimized);
            window->raise();
            window->activateWindow();
            
            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 4 May 2015, 21:51 last edited by
              #6

              Hi,

              Why not just clone and build QtApplication ? The qt-solutions repository contains it

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply 4 May 2015, 21:56
              0
              • S SGaist
                4 May 2015, 21:51

                Hi,

                Why not just clone and build QtApplication ? The qt-solutions repository contains it

                R Offline
                R Offline
                Robey Mardon
                wrote on 4 May 2015, 21:56 last edited by Robey Mardon 5 Apr 2015, 21:57
                #7

                @SGaist Too much, I looked into the source of the QtSingleApplication and it has a lot of deprecated methods, it was easier to create another one.

                The functions to raise the window I copied from there, nothing special.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 4 May 2015, 21:58 last edited by
                  #8

                  Which version did you got ? I just cloned and built it with Qt 5 without any problem

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  R 1 Reply Last reply 4 May 2015, 22:09
                  0
                  • S SGaist
                    4 May 2015, 21:58

                    Which version did you got ? I just cloned and built it with Qt 5 without any problem

                    R Offline
                    R Offline
                    Robey Mardon
                    wrote on 4 May 2015, 22:09 last edited by
                    #9

                    @SGaist Qt 5.4, but I did my own for other reasons as well, I want to create custom interaction with the running instance and the one that is going to be opened. - For example, if I want to open a new file and one instance is running already, I want to send custom messages to the running instance. I could do that using QtSingleApplication for sure using the method to send messages, but I don't want dependencies.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 4 May 2015, 23:58 last edited by
                      #10

                      You embed the code directly in your project if you don't want an additional module to link to

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      R 1 Reply Last reply 5 May 2015, 00:39
                      0
                      • S SGaist
                        4 May 2015, 23:58

                        You embed the code directly in your project if you don't want an additional module to link to

                        R Offline
                        R Offline
                        Robey Mardon
                        wrote on 5 May 2015, 00:39 last edited by
                        #11

                        @SGaist It might work, but as I said above, I want to create custom interactions and it's easier that way. - Thank you.

                        1 Reply Last reply
                        0

                        8/11

                        4 May 2015, 21:58

                        • Login

                        • Login or register to search.
                        8 out of 11
                        • First post
                          8/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved