×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    10

    Pausing an application on an incoming call

    Hi all, I just wonder how can I detect the incoming call while running an application?
    I'm new on Qt and I don't know what method on Qt that can perform showNotify / hideNotify as in Java did.
    Can anyone help me on this?
    Thank you.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Pausing an application on an incoming call

    Qt Mobility Telephony API was supposed to solve this problem, but its release is delayed until Qt Mobility 1.2
    http://doc.qt.nokia.com/qtmobility-1...ctiveCallAdded
    Another possibility is deprecated Mobile Extensions
    http://wiki.forum.nokia.com/index.php/Mobile_Extensions

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    51

    Re: Pausing an application on an incoming call

    Hi.

    When an incoming call comes in, your application gets a "QEvent::WindowDeactivate"-event and a "QEvent::WindowActivate" when the user either ends the call or take the call. So, you can set your app in a paused state on the "QEvent::WindowDeactivate"-event and when the "QEvent::WindowActivate" comes in you can set your app to wait for the user to touch the screen or something similar.



    Example (note: MyQtWidget inherits QWidget):

    // Custom event override, required for handling touch events
    bool MyQtWidget::event(QEvent* ev)
    {
    QEvent::Type type = ev->type();

    switch (type)
    {
    case QEvent::TouchBegin:
    {
    // TODO: handle touch by inspecting the event (ev)
    ev->setAccepted(true);
    return true;
    }
    case QEvent::TouchUpdate:
    case QEvent::TouchEnd:
    {
    // TODO: handle touch end by inspecting the event (ev)
    ev->setAccepted(true);
    return true;
    }
    case QEvent::WindowDeactivate:
    {
    // TODO: set my app in pause state
    ev->setAccepted(true);
    return true;
    }
    case QEvent::WindowActivate:
    {
    // TODO: set my app in "wait for user"-state
    return QWidget::event(ev);
    }

    default:
    return QWidget::event(ev);
    }
    }

    Hope this helps

    Quote Originally Posted by seaox View Post
    Hi all, I just wonder how can I detect the incoming call while running an application?
    I'm new on Qt and I don't know what method on Qt that can perform showNotify / hideNotify as in Java did.
    Can anyone help me on this?
    Thank you.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Pausing an application on an incoming call

    Usually no point of popping up old threads, like this has been here for 1.5 years already.

    Anyway, I suppose you would also get those events in other situations (like losing focus), thus if the functionality is really needed only for phone calls, then best option would be to use Native coding for telephony handling, with Symbian this would man utilizing CTelephony API.

Similar Threads

  1. Ending the incoming call from my application
    By mayankkedia in forum Symbian
    Replies: 8
    Last Post: 2010-12-23, 14:55
  2. Replies: 2
    Last Post: 2008-09-02, 03:00
  3. Replies: 0
    Last Post: 2006-07-25, 09:09
  4. How to get the number of an incoming call in j2me application?
    By adil035 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-03-28, 06:40
  5. Replies: 2
    Last Post: 2004-03-29, 07:48

Posting Permissions

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