dynup
23rd March 2015, 13:47
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;
class.cpp:
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);
(...)
void Class::readyRead() {
qDebug() << "Class::readyRead()";
}
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()));
or
process->start("adb", QStringList() << "blah", QProcess::ReadOnly | QIODevice::Text | QIODevice::Unbuffered);
doesn't work too!
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;
class.cpp:
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);
(...)
void Class::readyRead() {
qDebug() << "Class::readyRead()";
}
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()));
or
process->start("adb", QStringList() << "blah", QProcess::ReadOnly | QIODevice::Text | QIODevice::Unbuffered);
doesn't work too!