Sections

Single Application

The QtSingleApplication component provides support for applications that can be only started once per user.

 

For some applications it is useful or even critical that they are started only once by any user. Future attempts to start the application should activate any already running instance, and possibly perform requested actions, e.g. loading a file, in that instance.

The QtSingleApplication class provides an interface to detect a running instance, and to send command strings to that instance.

For console (non-GUI) applications, the QtSingleCoreApplication variant is provided, which avoids dependency on QtGui.

 

Documentation:

Classes: Examples:

Tested on:

  • Qt 4.4, 4.5 / Windows XP / MSVC.NET 2005
  • Qt 4.4, 4.5 / Linux / gcc
  • Qt 4.4, 4.5 / MacOS X 10.5 / gcc

Unsupported platforms:

Only the tested platforms are supported, however the classes should be platform independent and are likely to work on the platforms supported by Qt.

Download Commercial Edition:

Only available for Qt Solutions license holders with a valid Support and Maintenance agreement (authentication required).

Download Open Source Edition (LGPL):

Changes:

  • 2.6: LGPL release.
  • 2.6: Complete reimplementation. Visible changes:
  • 2.6: - QtSingleCoreApplication variant provided for non-GUI (console) usage
  • 2.6: - Fixed race condition where multiple instances migth be started
  • 2.6: - initialize() is now obsolete, no longer necessary to call it
  • 2.5: Mac: Fix isRunning() to work and report correctly.
  • 2.4: Fix the system for automatic window raising on message reception. NOTE: minor API change.
  • 2.3: Windows: Force creation of internal widget to make it work with Qt 4.2.
  • 2.2: Mac: Fix memory leak.
  • 2.2: Mac: fix crash due to wrong object releasing.
  • 2.2: Really fix the Mac compilation problem.
  • 2.1: Fix compilation problem on Mac.
  • 2.0: Version 1.3 ported to Qt 4.
Document Actions