This works fine, thanks a million!!
Qt Code:
  1. QStringList arguments;
  2. arguments << "-c" << "who|cut -d' ' -f1|sort -u";
  3. QProcess exec;
  4. exec.start("/bin/sh", arguments);
To copy to clipboard, switch view to plain text mode