Missing readyReadStdout() SIGNAL ?
-
I am trying to communicate - using stdin / stdout - with QProcess started application - xterm
I am following the example given in QProcess documentation and I have added connect and
(readFromStdout()) function / SLOT to my code.processTERMINAL = new QProcess(); QString exec = "xterm" ; // terminal"; QStringList params; connect( processTERMINAL, SIGNAL(readyReadStdout()), this, SLOT(readFromStdout()) );
I am getting this error
QObject::connect: No such signal QProcess::readyReadStdout() in /mnt/md127/MDI_WORK_COPY_FOLDER/MDI_BT_Oct4_BASE_NEW_MDI/LoCAL_SOURCE/mdi/CCC_mdichild.cpp:229
What am I missing in my code ?
Do I have to add SIGNAL readyReadStdout() ? -
Signal name is different:
readyReadStandardOutput
https://doc.qt.io/qt-5/qprocess.html#readyReadStandardOutput -
OK , I have changed the SIGNAL definition, it passes the run time test, however I am not getting the SIGNAL.
At this point I am not sure where is the problem....It an attempt to capture similar SIGNAL I added readAllStandardOutput() or readAllStandardError().
Now I am getting same error as before SIGNAL does no exists.BUT
here is the doc
so what gives?So far I have not specify any " channels " .
So do I have to specify channels for "stdin / stdout?
These are "predefined output channels"At this time I am trying to read from the QProcess started application, perhaps I need to make sure it is
optioned to send stdout data.Communicating via Channels
Processes have two predefined output channels: The standard output channel (stdout) supplies regular console output, and the standard error channel (stderr) usually supplies the errors that are printed by the process. These channels represent two separate streams of data. You can toggle between them by calling setReadChannel(). QProcess emits readyRead() when data is available on the current read channel. It also emits readyReadStandardOutput() when new standard output data is available, and when new standard error data is available, readyReadStandardError() is emitted. Instead of calling read(), readLine(), or getChar(), you can explicitly read all data from either of the two channels by calling readAllStandardOutput() or readAllStandardError().
-
@AnneRanch said in Missing readyReadStdout() SIGNAL ?:
am trying to communicate - using stdin / stdout - with QProcess started application - xterm
At this point I am not sure where is the problem....
As explained several times in your previous questions on this matter,
xterm
will not be sending anything to its stdout. So you won't get the signal if you run an interactivexterm
. -
This post is deleted!
-
@AnneRanch
It's not at all bothersome. You never fail to be as difficult as possible and usually rude to me, as everyone has noticed. I try to keep my answers as polite as possible.You state that you do not get signals from
xterm
for it outputting to stdout and ask why nothowever I am not getting the SIGNAL.
At this point I am not sure where is the problem....Why should I not reply to answer that? Because you don't like the answer? It doesn't change the fact that it is the answer. Which has been patiently explained to you over and over. Only instead of saying "thank you" and moving onto what you can actually do you either ignore or complain.
I think/hope most people would find my responses to you in Another xterm /QTextEdit issues helpful in explaining how things work and what you can/cannot do. And at https://forum.qt.io/topic/139374/another-xterm-qtextedit-issues/10 I took the time to write the code and show a screenshot of exactly what you will need to get the output from a sub-process like your
bluetoothctl
.I have no idea why you are hostile, mostly to me but to plenty of others too.
-
I have managed to have QProcess to receive SIGNAL from the external application.
What variable (stdin/stdout ) am I looking for to check the actual text in my function ?
See attached debug window.I am also looking for generic "read stdout" as implemented in Qt , but that is not that important - I like to verify the actuaql
contents of the "srdout" in debug mode first.Thanks
-
SOLVED
I canQString output = processTERMINAL->readAllStandardOutput();
Either after checking for
processTERMINAL->waitForReadyRead();
after the QProcess is running or
after SIGNAL is received from the xterm.
I would like to express my gratitude to all who helped to this solution.
-
@AnneRanch I am looking for a least theoretical reason, of course actual solution would be preferred , why the following is happening.
If i put ONLY "xterm" or "blutoothctl" as executable in QProcess , Qt will detect SIGNAL indicating change in stdout.
If I combine "xterm" to execute "bluetoothctl" I do not receive such SIGNAL.