PDA

View Full Version : Ensuring a single instance of an application in Linux



SeNSe
3rd May 2010, 08:37
I'm working on a GUI application in QT ( on UbUntu), and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and will fail quickly. How to use QMutex and semaphore in the main.cpp to do tht . If somebody could suggest the right code ...Thnx

Lykurg
3rd May 2010, 08:41
See QtSingleApplication: http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtsingleapplication

SeNSe
3rd May 2010, 10:57
Thnx a lot .. :)