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. Thanks for all your past and future contributions.

Adding event to native calender application on Meego Harmattan using QOrganizer API

From Wiki
Jump to: navigation, search

The code snippet shows how we can add an event to the native calender application on MeeGo Harmattan device using the QOrganizer API.

Article Metadata
Code ExampleTested with
SDK: Nokia Qt SDK 1.1.3
Devices(s): N9,N950
Keywords: QOrganizerManager, QOrganizerEvent,QOrganizerItem
Created: vineet.jain (07 Dec 2011)
Last edited: hamishwillee (11 Oct 2012)


#include <qorganizerevent.h>
#include <qorganizermanager.h>
#include <qorganizeritem>

In the .pro file, add the following lines:

CONFIG += mobility
MOBILITY += organizer


bool Cyourclass::addEventToCalender(const QString& alabeltext,const QString& aStartDateTime,const QString aEndDateTime)
QOrganizerManager m_manager;
QOrganizerEvent m_organizerEvent;
QDateTime startdatetime = QDateTime::fromString(aStartDateTime, "yyyy-MM-ddTHH:mm");
QDateTime enddatetime = QDateTime::fromString(aEndDateTime, "yyyy-MM-ddTHH:mm");
if (startdatetime > enddatetime ) {
return false;
m_organizerEvent.setStartDateTime(startdatetime );
m_organizerEvent.setEndDateTime(enddatetime );
// similarly more fields can be added to the event
return true;
This page was last modified on 11 October 2012, at 01:23.
39 page views in the last 30 days.