how to make system calls to be displayed in QLineEdit
hi friends/experts,
I have succeed in calling a system call inside my application
ex=> system("htmlview 192.168.1.4") ;
but is it possible to display the result of the command call to be display in QLineEdit
ex: I need to display ifconfig call to be display in my lineEdit
please help me to solve the problem ....
thanks
Re: how to make system calls to be displayed in QLineEdit
using system, not really.
possibilities
* shell redirection: system("your command > outputfile")
then read the file, unlink it, and display the contents
// not quite so portable as QProcess
// you need to generate a (free) temp. filename
// you need write access to some place
* use QProcess (this is what i would suggest)
HTH
Re: how to make system calls to be displayed in QLineEdit
thanks ya,
i made it so fine using QProcess
my code : QString program = "/sbin/ifconfig";
QStringList arguments;
arguments <<"eth0";
proc = new QProcess(this);
connect(proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readFromStdout()));
proc->start(program, arguments);
}
void Panel2::readFromStdout()
{
ui->resultTextEdit->setPlainText(proc->readAllStandardOutput() );
}
i made it.....