Description
SingleApplication is a C++ library for Qt 5 and Qt 6 that replaces the old QtSingleApplication. It ensures only one primary instance of your application runs: each later launch notifies the primary instance and then exits. If you enable it, secondary instances that are not tied to the primary can also run, and they can send data to the primary instance. The class inherits from whichever QCoreApplication or QGuiApplication class you choose with the QAPPLICATION_CLASS macro, so you use it like the normal application class. Internally it creates a QSharedMemory block and a QLocalServer; new instances check the shared memory and connect to the server to report themselves. You can include it as a git submodule with qmake or CMake, or fetch it with CMake's FetchContent. It is aimed at Qt developers building desktop apps that should behave as a single instance.…
Highlights
- Single-instance enforcement for Qt apps
- Qt 5 and Qt 6 support
- Optional secondary instances
- Send data from secondary to primary instance
- qmake, CMake and FetchContent integration
Ratings & Reviews
No ratings yet
Be the first to rate SingleApplication.
People also visit
SingleApplication FAQ
What does SingleApplication do?
It keeps a single primary instance of a Qt application running and terminates later instances after notifying the primary one.
Which Qt versions are supported?
Qt 5 and Qt 6.
Can other instances talk to the primary one?
Yes. If enabled, secondary instances can run and send data to the primary instance.
How do I add it to my project?
Add the repository as a git submodule and include singleapplication.pri (qmake) or the subdirectory (CMake), or use CMake's FetchContent module.
What are the best SingleApplication alternatives?
Popular alternatives to SingleApplication include Qt6windows7, QHexView and CXX QT. See all SingleApplication alternatives
