@AnneRanch
You have asked this so many times, and been answered. You cannot execute hcitool -i hci0 scan --flush | tee /tmp/temp as the command in process ->start(command). The answer is always the same:
process ->start("/bin/sh", QStringList() << "-c" << command);
YES, I can go back to passing data to "bash"...
BUT bash script does not accept some standard options likes "|" and "tee".
Completely incorrect. It is only either /bin/sh or /bin/bash which does accept and interpret |. tee has nothing to do with the shell, and works fine from either.
If I do pass QSTring to QPProcess - what is the corrent systex for passinf "system" function ?
There is no system-anything to pass to QProcess. system() is an alternative to using QProcess. You are better using QProcess in Qt programs and not system(). There is nothing system() does that QProcess() cannot do, but there are things you can do with QProcess which cannot be done with system(). You could save yourself time but not trying to use system(), I have shown you the equivalent process ->start() to use instead.
Which one of QProcess standard SIGNALs should I monitor for possible error?
void errorOccurred(QProcess::ProcessError error)
errorOccurred() is the signal for errors launching QProcess. You will doubtless be interested in other things which happen that are not process errors, even if you might think they should be. They may be reported by reading stderr (readyReadStandardError()) and possibly stdout too.
For the simplest case just use
const char *command = "hcitool -i hci0 scan --flush | tee /tmp/temp";
process ->start("/bin/sh", QStringList() << "-c" << command);
process->waitForFinished();
qDebug() << process->readAllStandardError();
qDebug() << process->readAllStandardOutput();
You should also connect on the errorOccurred signal, just in case.