How to get a QIODevice instance for stdin, stdout, stderr text streams in QtJambi?

I would like to receive QIODevice, which is the standard input and output streams ( stdin, stdout, stderr) in QtJambi, so that I can be notified when a new row can be read or written.

+5
source share
1 answer

Well, if you just want to implement a QIODevice for them, you can use something like

QFile stdin = new QFile();
stdin.open(0, new QIODevice.OpenMode(QIODevice.OpenModeFlag.ReadOnly));
QFile stdout = new QFile();
stdout.open(1, new QIODevice.OpenMode(QIODevice.OpenModeFlag.WriteOnly));
QFile stderr = new QFile();
stderr.open(2, new QIODevice.OpenMode(QIODevice.OpenModeFlag.WriteOnly));

(100% unsure of Java syntax since I only used Qt / C ++.)

, . , , , stdin/stdout, , , . QAbstractSocket.setSocketDescriptor().

+8

All Articles