How to set alarm in qt mobility application
Is it 开发者_高级运维possible to set an alarm for a specific time in Qt?
Use extension class XQAlarm.
This is generally part of Mobile Extensions offered in the SDK for a given OS. For Symbian, for example, you can find it on http://forum.nokia.com. (Please note that they might have been deprecated by Nokia as it XQAlarm of Alarms API was released under "technology review" program only for Symbian community by Nokia).
Here is example how to use XQAlarm:
// Creating a workday wakeup alarm
XQAlarms* alarms = new XQAlarms(this);
QDateTime alarmDateTime = alarmDateTime.currentDateTime();
alarmDateTime.setTime(QTime(15, 0));
// Create XQAlarm data object
XQAlarm weeklyReport;
weeklyReport.setExpiryTime(alarmDateTime);
weeklyReport.setMessage("Do weekly report");
weeklyReport.setRepeatDefinition(XQAlarm::RepeatWeekly);
alarms->addAlarm(weeklyReport);
精彩评论