4 #include <QSocketNotifier>
19 class Console :
public QObject
23 explicit Console (QObject *parent = 0) :
25 notifier(STDIN_FILENO, QSocketNotifier::Read)
27 connect(¬ifier, &QSocketNotifier::activated,
this, &Console::text);
31 void textReceived(QString message);
36 QTextStream qin(stdin);
37 QString line = qin.readLine();
38 emit textReceived(line);
41 QSocketNotifier notifier;