Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.0.0
-
None
Description
Qt 4 had a solution for singleton instance applications, which only had one window and when started again, simply activated that one window. This is primarily used by heavier applications, like webbrowsers, but has some merit.
Ways this could be implemented:
- Direct support in QtGui via QGuiApplication::setSingletonApplication(true/false) and QGuiApplication::activated(QStringList args), and backend support implemented in the specific platform plugins. Probably not too much work in QtGui, but requires IPC and new API in the platform plugins.
- Shell script. It seems firefox uses a shell script and a firefox.bin which is the actual application.
- Shell application, gives us a bit more flexibility and control compared to shell script. Could be written mostly with Qt.
If we do this as a shell app, we could simply do it as an example in qtbase/examples/gui/singleapp and have the right hooks for windows, linux and mac in the example itself. Users could use that as a basis for their own singleton applications.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-28967 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
187126,25 | Add QSingleApplication, enabling apps with a single instance policy | dev | qt/qtbase | Status: NEW | -2 | 0 |