0

I need to get my location in nokia QT.

I have the following code:

Rectangle {
            id: page
            width: 350
            height: 350
            PositionSource {
                id: positionSource
                updateInterval: 1000
                active: true
            onPositionChanged: {
                console.log("latitude : "+positionSource.position.coordinate.latitude);
                console.log("longitude :"+positionSource.position.coordinate.longitude);
            }
        }
}

In the project file I have set the capability and mobility configuration:

symbian:
{
    TARGET.CAPABILITY +=  Location
    CONFIG += mobility
    MOBILITY +=location
}

This code is run fine on the simulator, but on the real handset (Nokia 5530 XpressMusic) it doesn't work and I got this message:

[Qt Message] QGeoPositionInfoSource::createDefaultSource() requires the Symbian Location capability to succeed on the Symbian platform

What is the problem?

Jason Fox
  • 5,115
  • 1
  • 15
  • 34
Bayan
  • 283
  • 4
  • 14

1 Answers1

0

Other than some certification problems, that CAPABILITY+=Location line is sufficient.

However, after adding that, you must ensure that qmake is run at least once, so all your build scripts and metafiles are refreshed. If you are still getting that error after adding that line, just run qmake either from command line, or from project context manu in qtcreator

quetzalcoatl
  • 32,194
  • 8
  • 68
  • 107