Namespaces
Variants
Actions
(Difference between revisions)

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

Jump to: navigation, search
(Vineet.jain -)
m (Rahulvala -)
Line 1: Line 1:
[[Category:MeeGo 1.2 Harmattan]][[Category:Qt Mobility]][[Category:Code Snippet]][[Category:MeeGo]]
+
[[Category:MeeGo 1.2 Harmattan]][[Category:Qt Mobility]][[Category:Code Snippet]][[Category:MeeGo]][[Category:Qt]]
 
{{Abstract|The code snippet shows how we can add an event to the native calender application on MeeGo Harmattan device using the QOrganizer API.}}
 
{{Abstract|The code snippet shows how we can add an event to the native calender application on MeeGo Harmattan device using the QOrganizer API.}}
  

Revision as of 17:36, 13 December 2011

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 Example
Tested with
SDK: Nokia Qt SDK 1.1.3
Devices(s): N9,N950

Article
Keywords: QOrganizerManager, QOrganizerEvent,QOrganizerItem
Created: vineet.jain (07 Dec 2011)
Last edited: rahulvala (13 Dec 2011)


Headers

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

In the .pro file, add the following lines:

CONFIG += mobility
MOBILITY += organizer

Source

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.setDisplayLabel(alabeltext);
m_organizerEvent.setStartDateTime(startdatetime );
m_organizerEvent.setEndDateTime(enddatetime );
 
// similarly more fields can be added to the event
 
m_manager.saveItem(&m_organizerEvent);
return true;
}
310 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved