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: 237
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel

How to Store QVariantList to Database

Hi, I have a table field type VARCHAR, and I want to store a QVariantList to that field, is that posible?

 

Can I convert QVariantList to QString?

How to do this?

 

Thanks

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to Store QVariantList to Database

if you are sure that there are only strings you can use something like this (otherwise include canCovert or something like it):
QListIterator<QVariant> i(variantList);
while (i.hasNext()) {
stringList << i.next().toString();
}

also note that many simple Qt questions (like this) can be answered by checking other resources (read: googling it), as there are many nokia etc developer threads out there.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter