Results 1 to 5 of 5

Thread: How to detect whether a Qt application is running in foreground or background ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    22
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default How to detect whether a Qt application is running in foreground or background ?

    Does Qt application/ mainwindow or some other class provides an API to to detect whether a Qt application is running in foreground or background ?

    Or is there some kind of signal/ slot mechanism for the same. Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to detect whether a Qt application is running in foreground or background ?

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Posts
    22
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to detect whether a Qt application is running in foreground or background ?

    Thanks wysota.. I actually want a Signal mechanism.
    As in when some other application comes in foreground, i receive a signal in my running application and in the corresponding slot I can perform some action.

    the above API's you mentioned can be used when I specifically want to check the status of my application.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to detect whether a Qt application is running in foreground or background ?

    You asked for an API, you got an API. If you want a signal, ask for a signal

    A suitable signal might be QApplication::focusChanged.

Similar Threads

  1. how to detect if the NIC is up and running
    By sky in forum General Programming
    Replies: 0
    Last Post: 21st December 2010, 09:52
  2. Replies: 9
    Last Post: 14th September 2010, 18:00
  3. Receiving application foreground event
    By kokilakr in forum Qt Programming
    Replies: 0
    Last Post: 24th June 2010, 11:31
  4. How to detect a running application
    By yogesh in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2009, 10:22
  5. Replies: 5
    Last Post: 9th June 2008, 11:21

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
  •  
Qt is a trademark of The Qt Company.