Results 1 to 8 of 8

Thread: How to find the location of the user?

  1. #1
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Smile How to find the location of the user?

    Hi,

    I want to find from where the user has executing the application. The location need to be on the level of the country. Is there any way where i can find the same? Please give me some ideas to start with.

    Thanks in advance,
    Nikhil

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to find the location of the user?

    Is the application connected to the Internet?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to find the location of the user?

    yes. It is connected to internet. Is it possible to get the location from the IP address using Qt ?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to find the location of the user?

    sure - it has nothing to do with Qt itself.
    Google about IP address resolution.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to find the location of the user?

    yeah, I checked some of the sites offering this, but if i input the IP the values are not as expected. Anyways i will check again. Thanks. Please let me know if you got anything more on this. Thanks.

  6. #6
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: How to find the location of the user?

    Geographic location via IP address is always going to be hit and miss affair. The user could be going via a proxy etc..

    One other thing you could use, (also it wont always be accurate), would be to use the system locale.

    I'm presuming your app isnt on a mobile phone with access to GPS as this would be the only 100% reliable way of getting a location.

  7. #7
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to find the location of the user?

    GeoIP is a nice database, and there's a free version that's updated once per month. It's quite accurate within the US and Europe, possibly not so much elsewhere. You need access to a web server in order to run it.

    As noted above, determining locaiton from IP address is never going to be foolproof.

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to find the location of the user?

    As long as you don't need to be more accurate than "UK" or such like, using IP lookup should be OK most of the time, as long as you don't depend on the local IP address (as that could be masqueraded)

    You could look into Google's location aware services - these will give you town/city level information (eg. West Bromwich, UK), but you need to sign up with Google to get them and you must also ask the user for permission first. It also depends on the user having location aware devices such as a mobile phone or other device which can detect cellular towers.

Similar Threads

  1. HLine location
    By czlowiekcien in forum Newbie
    Replies: 2
    Last Post: 4th June 2009, 01:51
  2. Replies: 2
    Last Post: 27th November 2008, 11:16
  3. how to fix widget location
    By ht1 in forum Qt Programming
    Replies: 3
    Last Post: 22nd November 2007, 08:10
  4. Location of source for Qt
    By will49 in forum Newbie
    Replies: 2
    Last Post: 12th October 2007, 10:30
  5. Location of QGraphicItem!!
    By rachana in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2007, 22:20

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.