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
Highlighted
Developer
Posts: 293
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: QVariant to QString using saveToBuffer

how are you determining that the data is incomplete?

If you are using qDebug, maybe the debug output in the console is being truncated... however the data would all be there?
New Developer
Posts: 5
Registered: ‎03-22-2014
My Device: Z10
My Carrier: SUN

Re: QVariant to QString using saveToBuffer

Here's a sample code. 

 

QNetworkRequest request = QNetworkRequest();

QVariantMap secondEmployee;


secondEmployee["firstName01"] = "Westlee";
secondEmployee["lastName01"] = "Barichak";
secondEmployee["employeeNumber01"] = 63257801;

secondEmployee["firstName02"] = "Westlee";
secondEmployee["lastName02"] = "Barichak";
secondEmployee["employeeNumber02"] = 63257801;

secondEmployee["firstName03"] = "Westlee";
secondEmployee["lastName03"] = "Barichak";
secondEmployee["employeeNumber03"] = 63257801;

secondEmployee["firstName04"] = "Westlee";
secondEmployee["lastName04"] = "Barichak";
secondEmployee["employeeNumber04"] = 63257801;

secondEmployee["firstName05"] = "Westlee";
secondEmployee["lastName05"] = "Barichak";
secondEmployee["employeeNumber05"] = 63257801;

secondEmployee["firstName06"] = "Westlee";
secondEmployee["lastName06"] = "Barichak";
secondEmployee["employeeNumber06"] = 63257801;

secondEmployee["firstName07"] = "Westlee";
secondEmployee["lastName07"] = "Barichak";
secondEmployee["employeeNumber07"] = 63257801;

 

QVariant myData = QVariant(QVariantList() << QVariant(secondEmployee));

QString array;
JsonDataAccess json;
json.saveToBuffer(myData,&array);
qDebug() <<"---------------------------------------";
qDebug() << array;
qDebug() << json.hasError();

qDebug() << json.error();

 

The "array" output is incomplete . I also tried to send the "array" value in php and also receives an incomplete data as what QDebug show.

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: QVariant to QString using saveToBuffer

as already mentioned in this thread

qDebug truncates the output

 

write it to a file using JsonDataAccess and take a look at it

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
New Developer
Posts: 5
Registered: ‎03-22-2014
My Device: Z10
My Carrier: SUN

Re: QVariant to QString using saveToBuffer

My bad..thanks to all inputs. I saved the "array"  value to a file and its complete.

qDebug and console.log() in QML truncate the output..

 

Thanks to all.

New Developer
Posts: 5
Registered: ‎03-22-2014
My Device: Z10
My Carrier: SUN

Re: QVariant to QString using saveToBuffer

Issue solved.. qDebug and console.log() in qml truncate the output..thanks