Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Extract Location of the user
Qt 6.11 is out! See what's new in the release blog

Extract Location of the user

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ronak.rks
    wrote on last edited by
    #1

    Hi ,

    I am new to Qt, can you please share some samples of how can i extract the Latitude/Longitude information for an user ? I did check the documentation for "GeoLocation":http://doc.qt.nokia.com/qtmobility/qml-geolocation.html but it did not make much sense to me, so please share any sample / working code...

    Thanks
    Ronak

    1 Reply Last reply
    0
    • R Offline
      R Offline
      ronak.rks
      wrote on last edited by
      #2

      I am looking forward to a solution in QML.. or if it is not possible in QML then will i have to do something in C++ and then send data to QMLs ???

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rahul Das
        wrote on last edited by
        #3

        Welcome to forum,

        I am not much into QML , but in doc, seen GeoLocation.Latitude and GeoLocation.Longitude elements. And both are type double.

        Have you tried any of those location "examples":http://doc.qt.nokia.com/qtmobility/all-examples.html?


        Declaration of (Platform) independence.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ronak.rks
          wrote on last edited by
          #4

          Hi Rahul,

          Thanks for the link. But they are mostly on C++ not QML :(

          Anyway i did find the solution:

          @
          PositionSource{
          id: positionSource
          updateInterval: 1000
          active: true
          onPositionChanged: {
          userLocation.latitude = position.coordinate.latitude
          userLocation.longitude = position.coordinate.longitude
          }
          }
          @

          Thanks
          Ronak

          [EDIT: code formatting, please wrap in @-tags, Volker]

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rahul Das
            wrote on last edited by
            #5

            Cool :) So, it is solved :) Happy new year, and happy coding..


            Declaration of (Platform) independence.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved