Hi,
I wrote an appliaction for Android Debug Bridge (adb) to backup app data from an android device. But QProcess doesn't emit readRead signal, although adb gives an output:
class.h:
QProcess *process;
To copy to clipboard, switch view to plain text mode
class.cpp:
connect(process, SIGNAL(readyRead()), this, SLOT(readyRead()));
connect(process,
SIGNAL(finished
(int,
QProcess::ExitStatus)),
this,
SLOT(finished
(int,
QProcess::ExitStatus)));
process = new QProcess(this);
connect(process, SIGNAL(readyRead()), this, SLOT(readyRead()));
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finished(int, QProcess::ExitStatus)));
process->start("adb", QStringList() << "blah", QProcess::ReadOnly);
To copy to clipboard, switch view to plain text mode
(...)
void Class::readyRead() {
qDebug() << "Class::readyRead()";
}
void Class::readyRead() {
qDebug() << "Class::readyRead()";
}
To copy to clipboard, switch view to plain text mode
In terminal the message is coming, than i confirm it on the device and than it's done. In QProcess the readRead signal is emitted after confirming on device! Why?
Thanks!
P.S.
connect(process, SIGNAL(readyReadStandardOutput), this, SLOT(readyRead()));
connect(process, SIGNAL(readyReadStandardOutput), this, SLOT(readyRead()));
To copy to clipboard, switch view to plain text mode
or
process->start("adb", QStringList() << "blah", QProcess::ReadOnly | QIODevice::Text | QIODevice::Unbuffered);
To copy to clipboard, switch view to plain text mode
doesn't work too!
Bookmarks