#include "nonblockedinput.h"

NonBlockedInput::NonBlockedInput(QObject *parent)
{
    this->moveToThread(&thread);
    connect(&thread,&QThread::started, this, &NonBlockedInput::ReadLine);
    thread.start();
}

void NonBlockedInput::ReadLine()
{
    QTextStream inputStream(stdin);
    QString line;

    while (inputStream.readLineInto(&line)){
        emit LineIsRead(line);
    }
}
