×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    5

    Receiving application foreground events

    Is there a way in QtS60 to easily capture application foreground events? In S60 it can be done via AppUi::HandleForegroundEventL() but I don't know if it's possible to overload the AppUi handler of a Qt application.

    I only need foreground events for my own application, so using CFgrObserver is a little overkill with its SwEvent capability.

    I tried using QWidget::changeEvent, but I only get QEvent::ActivationChange events without the ability to distinguish between foreground and background events.

    QEvent::ApplicationActivate seems like the logical event to use in this case, but I never observe it in the QWidget::changeEvent slot. I am using a custom widget that draws on a full screen.
    Last edited by daou; 2009-06-02 at 17:26.

  2. #2
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Receiving application foreground events

    QWidget::changeEvent is only for change events (see documentation http://doc.trolltech.com/4.5/qwidget.html#changeEvent).

    How about adding an eventFilter into your application / widget and trying to handle ApplicationActivate event there?

    Cheers,
    FB

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    5

    Re: Receiving application foreground events

    Thanks for the reply.

    The QWidget did not receive the ApplicationActivate/Deactivate events in eventFilter(). I derived a class from QApplication and installed the event filter there, and it gets the events during foreground/background as it should. So it's working now.

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    Re: Receiving application foreground events


Similar Threads

  1. Replies: 5
    Last Post: 2008-10-04, 10:59
  2. How to receive softkey events in Flash lite application embedded in HTML
    By keerthivasanp in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2008-09-30, 14:27
  3. How can I keep Application always foreground
    By saiful_nokia in forum Symbian
    Replies: 5
    Last Post: 2008-07-15, 13:57
  4. Replies: 1
    Last Post: 2008-04-24, 14:23
  5. Bringing Background application to foreground
    By Varadarajanm in forum Symbian
    Replies: 1
    Last Post: 2007-02-21, 02:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •