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.
  • Robey MardonR Offline
    Robey MardonR Offline
    Robey Mardon
    wrote on last edited by Robey Mardon
    #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 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/)

      Robey MardonR 1 Reply Last reply
      1
      • M mcosta

        HI and welcome to devnet,

        QtSingleApplication is not part of Qt

        Robey MardonR Offline
        Robey MardonR Offline
        Robey Mardon
        wrote on last edited by Robey Mardon
        #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 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/)

          Robey MardonR 1 Reply Last reply
          0
          • M mcosta

            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

            Robey MardonR Offline
            Robey MardonR Offline
            Robey Mardon
            wrote on last edited by Robey Mardon
            #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
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 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

              Robey MardonR 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

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

                Robey MardonR Offline
                Robey MardonR Offline
                Robey Mardon
                wrote on last edited by Robey Mardon
                #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
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 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

                  Robey MardonR 1 Reply Last reply
                  0
                  • SGaistS SGaist

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

                    Robey MardonR Offline
                    Robey MardonR Offline
                    Robey Mardon
                    wrote on 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
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 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

                      Robey MardonR 1 Reply Last reply
                      0
                      • SGaistS SGaist

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

                        Robey MardonR Offline
                        Robey MardonR Offline
                        Robey Mardon
                        wrote on 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

                        • Login

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