QtSingleApplication No such file or directory [SOLVED]
-
I tried to include QtSingleApplication and I got this error: No such file or directory.
#include <QtSingleApplication>
.pro:
QT += core gui widgets
-
@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 fromQApplication
and created theQLocalServer
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();
-
Hi,
Why not just clone and build QtApplication ? The qt-solutions repository contains it
-
@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.
-
Which version did you got ? I just cloned and built it with Qt 5 without any problem
-
@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. -
You embed the code directly in your project if you don't want an additional module to link to