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] QtSingleApplication and Qt 5
Forum Updated to NodeBB v4.3 + New Features

[solved] QtSingleApplication and Qt 5

Scheduled Pinned Locked Moved General and Desktop
8 Posts 6 Posters 24.6k 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.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by
    #1

    The latest version of QtSingleApplication does not compile with Qt 5 because of some QT_WA macros that are not present. Is there any way to use QtSingleApplication in Qt 5 project?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Itehnological
      wrote on last edited by
      #2

      QSingleApplication uses lots of deprecated classes and methods in Qt5 so you should look for an alternative.
      I created a similar functionality with QLocalServer and QLocalSocket.
      I can share the source...

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JulienMaille
        wrote on last edited by
        #3

        Yes please share!

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          [quote author="Violet Giraffe" date="1356206549"]Is there any way to use QtSingleApplication in Qt 5 project?[/quote]The Qt Solutions Archive has been added to Qt Project Code Review system recently, so patches for Qt5 might finally go in.

          Until then, feel free to clone the "patched QtSingleApplication":http://qt.gitorious.org/~lgeyer/qt-solutions/lgeyers-qt-solutions, which should work with Qt4 as well as with Qt5.

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Itehnological
            wrote on last edited by
            #5

            "SingleApplication Repository":https://github.com/Itehnological/SingleApplication

            Take a look at the main.cpp. My Class just replaces the QGuiApplication like QSingleApplication does. Also connect to the showUp signal to implement the focus on the main instance window when another instance is initiated.

            The last is best achieved like this:
            @
            window->hide();
            window->showExpanded();
            @

            1 Reply Last reply
            0
            • V Offline
              V Offline
              Violet Giraffe
              wrote on last edited by
              #6

              Much appreciated!

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bunjee
                wrote on last edited by
                #7

                Thanks Guys <3 !

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  astodolski
                  wrote on last edited by
                  #8

                  [quote author="Lukas Geyer" date="1356255913"][quote author="Violet Giraffe" date="1356206549"]Is there any way to use QtSingleApplication in Qt 5 project?[/quote]The Qt Solutions Archive has been added to Qt Project Code Review system recently, so patches for Qt5 might finally go in.

                  Until then, feel free to clone the "patched QtSingleApplication":http://qt.gitorious.org/~lgeyer/qt-solutions/lgeyers-qt-solutions, which should work with Qt4 as well as with Qt5.

                  [/quote]

                  Will not build using Qt 5.1.1 libraries on Windows

                  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