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
New Developer
Posts: 88
Registered: ‎06-16-2012
My Device: N950/E7/N808/N9/X7/BB10 Alpha
My Carrier: Kievstar

QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

hi all

 

trying to get current location from an Qt (not cascades) app but when calling QGeoPositionInfoSource::createDefaultSource(this), it returns null pointer

<permission>access_location_services</permission> is set

how to solve the issue?

Qt/Symbian/Meego/BB10/Cascades developer
BlackBerry Development Advisor
Posts: 68
Registered: ‎10-15-2012
My Device: Z10
My Carrier: Telus

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

Hi,

 

To use QGeoPositionInfoSource you must set the read_geolocation permission in your bar-descriptor.xml file. Though it's also a good idea to set the access_location_services permission, as you have done, since its impact may vary with beta NDK releases. You can alternatively enable Location Services under Settings on your device.

 

<permission>read_geolocation</permission>
<permission>access_location_services</permission>

 

Regards,

Jim

New Developer
Posts: 88
Registered: ‎06-16-2012
My Device: N950/E7/N808/N9/X7/BB10 Alpha
My Carrier: Kievstar

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

thanks, but didnot helped :smileysad:

Qt/Symbian/Meego/BB10/Cascades developer
BlackBerry Development Advisor
Posts: 68
Registered: ‎10-15-2012
My Device: Z10
My Carrier: Telus

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

Sorry to hear, are you using the latest NDK, and device image?

 

Jim

New Developer
Posts: 88
Registered: ‎06-16-2012
My Device: N950/E7/N808/N9/X7/BB10 Alpha
My Carrier: Kievstar

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

sure, 10.0.9.388

Qt/Symbian/Meego/BB10/Cascades developer
Developer
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

[ Edited ]

On what's running this code ? PlayBokook or Dev Alpha ?

 

actually try this QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(0);

New Developer
Posts: 88
Registered: ‎06-16-2012
My Device: N950/E7/N808/N9/X7/BB10 Alpha
My Carrier: Kievstar

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

Dev Alpha

QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(0);

did not help too :smileysad:

Qt/Symbian/Meego/BB10/Cascades developer
Developer
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

New Developer
Posts: 88
Registered: ‎06-16-2012
My Device: N950/E7/N808/N9/X7/BB10 Alpha
My Carrier: Kievstar

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

locationdiagnostic sample works. at least I've got a pointer

I'm afraid this works only for cascades apps, ie apps, initialized with Cascades Application() class

Qt/Symbian/Meego/BB10/Cascades developer
BlackBerry Development Advisor
Posts: 68
Registered: ‎10-15-2012
My Device: Z10
My Carrier: Telus

Re: QGeoPositionInfoSource::createDefaultSource(this) returns null pointer

Are you using QApplication or QCoreApplication instead? Are you changing the Qt library paths?