×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    2

    Get My Current Location Lat, lon

    hi
    how i can get My Current Location Lat, lon whit QTMobility ?
    thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Get My Current Location Lat, lon


  3. #3
    Registered User
    Join Date
    Jul 2011
    Posts
    2

    Re: Get My Current Location Lat, lon

    thanks somnathbanik
    I can write my code and compile and built it, but it don't work

    void MainWindow:n_pushButton_clicked()
    {
    QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
    if (source) {
    connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
    this, SLOT(positionUpdated(QGeoPositionInfo)));
    source->startUpdates();
    }
    }
    void MainWindow:ositionUpdated(const QGeoPositionInfo &info)
    {
    double m_latitude;
    QGeoCoordinate coord = info.coordinate();
    m_latitude = coord.latitude();
    // m_longitude = coord.longitude();
    ui->pushButton->setText(QString::number(m_latitude));
    }

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Get My Current Location Lat, lon

    how can you say it didnt work, did you get any error message.

    From you rough code what i can see is you haven't mentioned the PositioningMethod, there is no way to know time out occurred or not.

    So the case may be your phone might be a indoor position where it takes some time to get the GPS fix and thus position.

    I will advice you to first set PositioningMethod, then set a time out period and check again.

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    76

    Re: Get My Current Location Lat, lon

    Hi
    Can I suggest that you have a look at the bugs raised against the location API's ,

    http://lists.qt.nokia.com/pipermail/...il/000996.html

    http://bugreports.qt.nokia.com/browse/QTMOBILITY-1501

    http://bugreports.qt.nokia.com/browse/QTMOBILITY-1550

    I had issues with the Qt location API's and the solution I got from the good folks at the paid support was to write a wrapper to the underlying Symbian c++ API's.

    regards

    Guus

Similar Threads

  1. [Moved] GPS Live Tracking Lat Lon Retrieval
    By lokesh_kumar_s in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2010-06-19, 08:18
  2. Convert lat/lon to address data
    By brendanmc25 in forum Mobile Java General
    Replies: 3
    Last Post: 2010-04-01, 05:35
  3. How to get current location details from lat and long?
    By kalki in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-03-19, 06:21
  4. unable to receive lat,lon information using JSR 179
    By rajpraveen in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2007-10-23, 07:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×