Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to use QAlarm to manage alarms on your phone

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia C7-00, Nokia N8
Compatibility
Platform(s):
Symbian
Platform Security
Signing Required: DevCert
Capabilities: ReadUserData,ReadDeviceData,ReadUserData,WriteDeviceData,WriteUserData
Article
Keywords: Alarms
Created: galazzo (21 Jun 2012)
Last edited: kiran10182 (30 Oct 2013)

Contents

Introduction

This article explains how to use QAlarm, a Qt/QML component that help you to manage system alarms on your phone.

Using QAlarm

  • Download source code from here
  • Include QAlarm directory into your project

Note.pngNote: You need to sign application with your developer certificate

.pro

include(./QAlarm/alarm.pri)

main.cpp

#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
 
#include <QtDeclarative>
#include "QAlarm/qalarm.h"
 
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
 
qmlRegisterType<QAlarm>("QAlarm", 1, 0, "QAlarm");
 
QmlApplicationViewer viewer;
viewer.setMainQmlFile(QLatin1String("qml/QAlarmSample/main.qml"));
viewer.showExpanded();
 
return app->exec();
}

QML

import QtQuick 1.1
import com.nokia.symbian 1.1
import QAlarm 1.0
 
Page {
id: mainPage
width: 360
height: 640
 
Column {
anchors.fill: parent
spacing:10
 
Row {
spacing: 10
Text {
text: qsTr("Message")
}
TextInput {
id:message
text: "Job meeting"
cursorVisible: false
font.pixelSize: 20
}
}
 
Row {
spacing: 10
Text {
text: qsTr("Interval")
}
TextInput {
id:interval
text: "5"
cursorVisible: false
font.pixelSize: 20
}
}
 
Button {
id:btn_alarm
text: "Set alarm"
onClicked: {
alarm.add(message.text, parseInt(interval.text))
}
}
}
 
QAlarm {
id:alarm
}
}
This page was last modified on 30 October 2013, at 20:02.
46 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×