Results 1 to 6 of 6

Thread: Get current ip address

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Get current ip address

    Hi, I have problem with ip address.
    How can i get current ip address on my pc? I tried used this code:

    Qt Code:
    1. QHostInfo info;
    2. QNetworkInterface ifObj = QNetworkInterface::interfaceFromName(info.hostName());
    3. qDebug() << ifObj;
    To copy to clipboard, switch view to plain text mode 
    It was returned:
    Qt Code:
    1. QNetworkInterface( name = "", hardware address = "", flags = , entrise = () )
    To copy to clipboard, switch view to plain text mode 
    also I used function: QNetworkAddressEntry::ip () , but without results.

    So, I wait for yours propositions to solve my problem.
    Last edited by Trok; 16th March 2009 at 20:53.

Similar Threads

  1. Can I get current rotation of a QGraphicsView?
    By bjh in forum Qt Programming
    Replies: 5
    Last Post: 2nd October 2008, 22:04
  2. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  3. Replies: 15
    Last Post: 21st April 2007, 17:46
  4. Replies: 1
    Last Post: 19th April 2007, 22:23
  5. How to get current row(column) index in the QTextTable?
    By denny.t in forum Qt Programming
    Replies: 3
    Last Post: 5th April 2006, 07:53

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
  •  
Qt is a trademark of The Qt Company.