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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 20
Registered: ‎09-12-2012
My Device: Developer
My Carrier: Docomo

How to use Qt Database Classes in Beta 3

I have used Qt Database classes in Beta 2 but in Beta 3 it was not identifying why is it possible to add Qt Database Classes to our application in Beta3 and create DataBase in our App

Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: How to use Qt Database Classes in Beta 3

Could you be more specific?  I've used Qt's database classes in most of my BB10/Cascades work, and that's one of the few areas of my code that I have not had to make any changes to as I've gone from beta 1 to beta 2 to beta 3.

 

(I'm mostly using QSqlDatabase with its SQLite backend.)

Highlighted
Contributor
Posts: 20
Registered: ‎09-12-2012
My Device: Developer
My Carrier: Docomo

Re: How to use Qt Database Classes in Beta 3

iam currently using beta3 version in that iam using code like this 

 QSqlDatabase *connecor=QSqlDatabase::addDatabase("SQLITE");

but it was raising an exception as like this 

 

Multiple markers at this line
- 'QSqlDatabase' is not a class or
namespace
- 'QSqlDatabase' was not declared in
this scope
- 'connecor' was not declared in this
scope

 

so what i have to do is there any additional configaration?

Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: How to use Qt Database Classes in Beta 3

Well, you do need to include the header file for this stuff at the top of your source file:

 

#include <QtSql/QtSql>

 

Also, the addDatabase() function doesn't return a pointer type, so remove the asterisk.

 

I also suggest adding the connectionName argument to addDatabase(), just in case you plan to use more than one SQLite DB in your app.  It'll prevent conflicts and make your life easier in the future.