Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 30
Registered: ‎11-06-2012
My Device: BB 10 Dev Alpha
My Carrier: MegaFon

PpsObject encoding error (QDateTime)

[ Edited ]

Hi everybody!

 

I'm trying to create a new event in the system calendar using the Invocation Framework. Unfortunately, the following produces assertion failure:

	QVariantMap requestData;

	requestData["startTime"] = QDateTime::currentDateTime();

	bool ok = true;
	QByteArray encodedRequestData = bb::PpsObject::encode(requestData, &ok);
	if (!ok)
	{
		Q_ASSERT(false);
		return;
	}

 This does not happen for QString data, though. Any ideas about what could produce the error?

Thanks in advance

Developer
Posts: 30
Registered: ‎11-06-2012
My Device: BB 10 Dev Alpha
My Carrier: MegaFon

Re: PpsObject encoding error (QDateTime)

[ Edited ]

Solved this issue. I tried to encode datetime itself instead of it's string representation. I've changed 

QDateTime::currentDateTime()

 to

QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")

 and this solved the problem.

UPD: Though encoding works now, calendar still does not work properly. The shown dialog ignores the "startTime" parameter. I've created a new thread for this new problem.