Results 1 to 5 of 5

Thread: How to assign IP address to eth0 in QT

  1. #1
    Join Date
    Feb 2011
    Location
    Korea
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to assign IP address to eth0 in QT

    Hi.
    I would like to assign Ip address to eth0 which is not assigned IP address in QT

    is this possible?

    generally

    #ifconfig eth0 192.168.121.1 up

    I would like to make a code like above function in Qt

    Help me..

  2. #2
    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 assign IP address to eth0 in QT

    Use QProcess to execute the above command ?

  3. #3
    Join Date
    Feb 2011
    Location
    Korea
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to assign IP address to eth0 in QT

    No.

    I would like to make code Using Network classes

  4. #4
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to assign IP address to eth0 in QT

    simply, you cannot.

    this task is not platform independent, so you have to use Native APIs or QProcess to launch external program
    A camel can go 14 days without drink,
    I can't!!!

  5. #5
    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 assign IP address to eth0 in QT

    Quote Originally Posted by csw00700 View Post
    No. I would like to make code Using Network classes
    As stated, the network classes do not support this.

    If you require this functionality in code (rather than just executing the said application), you could always include the code from ifconfig source (but of course, this would mean you must not license your application under a more restrictive license than ifconfig itself)

Similar Threads

  1. Cannot assign to pixmap during painting
    By fanatos in forum Qt Programming
    Replies: 9
    Last Post: 22nd February 2016, 17:56
  2. How to correctly re-assign a pointer?
    By homerun4711 in forum Newbie
    Replies: 26
    Last Post: 4th January 2011, 16:39
  3. Assign a wchar_t array to QString
    By jacky in forum Qt Programming
    Replies: 5
    Last Post: 18th April 2009, 12:28
  4. boost::assign
    By Sivert in forum General Programming
    Replies: 0
    Last Post: 2nd May 2007, 00:23
  5. I can't assign TableView signals...
    By tomek in forum Newbie
    Replies: 5
    Last Post: 9th January 2006, 21:04

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.