Results 1 to 5 of 5

Thread: How to get the ip address of the laptop in which i run my application

  1. #1
    Join Date
    Oct 2016
    Posts
    7
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Symbian S60

    Talking How to get the ip address of the laptop in which i run my application

    Hello again My teachers. this time i have an application made by Qt framework. i want to get the Global ip address of the machine in which i run my application.
    the same Ip address given by this website https://www.whatismyip.com/ thank you soo much in advance for you time.

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: How to get the ip address of the laptop in which i run my application

    You can use their API Quick Start guide to learn how to programmatically determine your internet ip address. You'll need to use QNetworkAccessManager, QNetworkRequest, and QNetworkReply to make the API request and the QJson* classes to parse the output.

    To use their API, you'll need to be a gold level member, which costs $25 per year, but there are other free sites like https://www.ipify.org/ to do the same for free.

    Good luck.
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

  3. The following user says thank you to jefftee for this useful post:

    Christina flowers (14th October 2016)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get the ip address of the laptop in which i run my application

    I like http://icanhazip.com/ as it just returns the IP address as plain text, nothing else.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    Christina flowers (14th October 2016)

  6. #4
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: How to get the ip address of the laptop in which i run my application

    Quote Originally Posted by anda_skoa View Post
    I like http://icanhazip.com/ as it just returns the IP address as plain text, nothing else.
    Even better!
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

  7. #5
    Join Date
    Oct 2016
    Posts
    7
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Symbian S60

    Default Re: How to get the ip address of the laptop in which i run my application

    thank you soo much for you reply i apreciate that.

    thank you so much. great answer

Similar Threads

  1. Replies: 1
    Last Post: 1st August 2013, 06:22
  2. UI file showing different in desktop and laptop ..
    By riarioriu3 in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2012, 10:44
  3. Application is fully functional ONLY on my laptop
    By juracist in forum Installation and Deployment
    Replies: 17
    Last Post: 24th June 2012, 23:58
  4. problem using qt mobility with my laptop camera
    By eyaler in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 27th May 2012, 18:40
  5. Qt application to change ip address
    By nighil in forum Qt-based Software
    Replies: 2
    Last Post: 23rd January 2011, 09:32

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.