Results 1 to 7 of 7

Thread: How to prevent many instances of same application from running ?

  1. #1
    Join Date
    May 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default How to prevent many instances of same application from running ?

    I have built an application that plays audio but when I select multiple audio files and press "Enter" , each audio file is played by different instance of same application. I want to prevent multiple copies of my application from running at the same time. Instead I want that if many audio file are run, they should be added in the media player's playlist. How can this be done ?

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to prevent many instances of same application from running ?

    Look at this solution

  3. #3
    Join Date
    May 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How to prevent many instances of same application from running ?

    Quote Originally Posted by Lesiok View Post
    Well QtSingleApplication is not compatible with Qt 5.

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to prevent many instances of same application from running ?


  5. #5
    Join Date
    May 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How to prevent many instances of same application from running ?

    Quote Originally Posted by Lesiok View Post
    So I guess that QtLocalPeer is the replacement for QtSingleApplication . Am I correct ? If so, can u provide an example code which shows the usage of QtlocalPeer ?

  6. #6
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to prevent many instances of same application from running ?

    No, I can't. I do not work with Qt5 only Qt4.
    As you probably noticed it is the solution used in QtCreator. Sources of QtCreator are generally available so look for them.

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to prevent many instances of same application from running ?

    As far as I understood the linked page, the API is still QtSingleApplication, just a newer implementation based on QtLocalPeer.

    Cheers,
    _

Similar Threads

  1. How can I prevent audio application to abort?
    By davidlamhauge in forum Qt Programming
    Replies: 9
    Last Post: 18th December 2013, 11:24
  2. Replies: 5
    Last Post: 13th November 2012, 12:43
  3. How to prevent multiple executables from application
    By jshafferman in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2011, 19:44
  4. Replies: 1
    Last Post: 18th August 2010, 13:39
  5. Limiting the number of instances of one application
    By fullmetalcoder in forum Qt Programming
    Replies: 29
    Last Post: 16th May 2009, 14:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.