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.
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.
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
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
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.