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: 120
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none
Accepted Solution

LIBS needed in .pro file for using QAccelerometer, QAccelerometerReading

hi , 

    i want to use QAccelerometer and QAccelerometerReading class in my app. So, which all libs to include for them.

And where will i get the list of libs to include for using these classes.

 

Regards,

Sanjeev

Developer
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: LIBS needed in .pro file for using QAccelerometer, QAccelerometerReading

Add following to your .pro file:

CONFIG += mobility
MOBILITY += sensors

 You can read more about using sensors under BlackBerry 10 here: https://developer.blackberry.com/cascades/documentation/device_comm/sensors/index.html

 

-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Developer
Posts: 120
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none

Re: LIBS needed in .pro file for using QAccelerometer, QAccelerometerReading

[ Edited ]

I am using these in .pro but then also i am getting the errors

 

Unresolved inclusion: <QtSensors/QAccelerometerReading>

Unresolved inclusion: <QtSensors/QAccelerometer>

 

'QAccelerometer' does not name a type

Developer
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: LIBS needed in .pro file for using QAccelerometer, QAccelerometerReading

What kind of errors? Provide IDE output so we can think for definitely.
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Developer
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: LIBS needed in .pro file for using QAccelerometer, QAccelerometerReading

Have you add
using namespace QtMobility
in your source file?
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Developer
Posts: 120
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none

Re: LIBS needed in .pro file for using QAccelerometer, QAccelerometerReading

Oops, it was missing. now added and will check .