Nessuna uscita con QProcess

0

Domanda

Ho scritto una applicazione per analizzare l'output del comando dei dati con Qt 6 con il C++.

Ho anche scritto uno script Python per testare la mia applicazione, si ama:

import time
while True:
    print("blah blah blah")
    time.sleep(1)

Quando viene utilizzato QProcess::SeparateChannelsil readyRead() non ha emessa, e readAllStandardError() di ritorno a vuoto. Ma quando viene utilizzato QProcess::ForwardedChannelsil processo di uscita inoltrato bene.

Ho provato ad aprire QProcess con Unbuffered, e ha aggiunto flush=True nel mio script Python. Ma readAllStandardError() di ritorno a vuoto, troppo.

Cosa posso fare per correggere questo errore?

qprocess qt qt6 qtcore
2021-11-18 14:30:20
1

Migliore risposta

1

Trovati risoluzione. Aggiungere flush=True nello script Python.

2021-11-19 12:25:37

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................