×
Namespaces

Variants
Actions

How to use QAlarm to manage alarms on your phone

From Nokia Developer 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 23:02.
52 page views in the last 30 days.