Hey all,
I have a strange problem with QProcess, I use QProcess and system command "whoami" to get current logged in user.
/** where "user" is the QLabel"**/
QString whoamiCom
= "/usr/bin/whoami";
//i also tried with just "whoami" userproc->start(whoamiCom);
user->setText(userproc->readAllStandardOutput());
/**I also tried using this method:
QByteArray result = userproc->readAll();
user->setText(result); **/
/** where "user" is the QLabel"**/
QString whoamiCom = "/usr/bin/whoami"; //i also tried with just "whoami"
QProcess *userproc = new QProcess(this);
userproc->start(whoamiCom);
user->setText(userproc->readAllStandardOutput());
/**I also tried using this method:
QByteArray result = userproc->readAll();
user->setText(result); **/
To copy to clipboard, switch view to plain text mode
in anyway the program compiles and runs but nothing is parsed on "user" Label.
Please help, thx
Bookmarks