[solved] QtSingleApplication and Qt 5
-
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?
-
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... -
Yes please share!
-
[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.
-
"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();
@ -
Much appreciated!
-
Thanks Guys <3 !
-
[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