Hi guys,
I'm trying to write an application that gets the location of the phone using the 'Network based' positioning method.
Unfortunately, setting the preferred positioning method to 'NonSatellitePositioningMethods' doesn't seem to have any effect, even though calls to supportedPositioningMethods() return the 'AllPositioningMethods' flag.
I'm running my program on a Nokia N95 with Qt Mobility 1.0.0 installed, indoors (therefore no GPS reception) but with good network reception.
If I edit the positioning methods in the phone's settings app so that only 'Network based' is available, the following code returns a network-based location.
However, if I enable 'Assisted GPS' in the phone's settings, my preferred positioning method setting is ignored, the phone attempts to use GPS, and the position request times out.
Is this a bug, or am I just doing it wrong?
Code:Positioning::Positioning(QObject *parent) : QObject(parent) { QGeoPositionInfoSource *positionManager = QGeoPositionInfoSource::createDefaultSource(this); positionManager->setPreferredPositioningMethods(QGeoPositionInfoSource::NonSatellitePositioningMethods); connect( positionManager, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo)) ); connect( positionManager, SIGNAL(updateTimeout()), this, SLOT(updateTimeout()) ); positionManager->requestUpdate(30000); // time out after 30 seconds } void Positioning::positionUpdated(QGeoPositionInfo position) { qDebug() << "Position request succeeded."; } void Positioning::updateTimeout() { qDebug() << "Position request timed out."; }



