Important: Please read the Qt Code of Conduct -

[Closed] Ip address set using Qt application

  • Hi,
    I am working on an embedded project (Linux os running on ARM 9 processor). Qt is used for GUI.
    currently I have to develop an application which can set/reset the Ip address of the device using Qt application. Till now I am able to get the IP address of the device through Qt by using Qprocess and ifconfig etc but I am not been able to change the Ip address.
    Here is the snippet :

    QString setbuff;
    char* ip_buff = "";
    setbuff.sprintf("ifconfig eth0 %s netmask up",ip_buff);
    qDebug() << setbuff;

    QProcess *qProc = new QProcess(this);

    qDebug() << setbuff;
    QString tmp = qProc->readAll();

    The set buff content is showing correctly as : “ifconfig eth0 netmask up”
    But when the code is cross compiled and run on the target embedded device, the Ip address is not setting as
    BTW the target device is executing the code in root mode.

    Please help me solve this problem q

    [Edit: added @-tags /Vass]

  • Closing this topic "too": This is the third "topic": you opened on this subject. Really, this is not the way to behave here on the forum.

Log in to reply