[Qt-interest] QProcess not emitting readyRead for blocking processes

Rohan Prabhu rohan at rohanprabhu.com
Tue Sep 7 15:11:14 CEST 2010


Here's the setup I got:

    QStringList arguments;
    QProcess ssh;
    ProcessManager p(&ssh);

    arguments<<"-f";
    arguments<<"/var/log/messages";
    QObject::connect(&ssh,
SIGNAL(stateChanged(QProcess::ProcessState)), &p,
SLOT(stateChanged(QProcess::ProcessState)));
    QObject::connect(&ssh, SIGNAL(readyRead()), &p, SLOT(readLeft()));

    ssh.start(QString("tail"), arguments);

The following program just doesn't emit the readyRead signal. If I
change it to something like:

    arguments<<"\"Hello World\"";
    ssh.start(QString("echo"), arguments);

it is working properly. As in, the singal is emitted and the connected
slot outputs it. I am having a problem with the following programs:

1. tail [with the -f option]
2. wget
3. ssh

The following ones work:

1. tail [without the -f option[
2. echo
3. cat

Anyone has any clues as to why?

Regards,
rohan



More information about the Qt-interest-old mailing list