Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by D ( 13 years ago )
void MainWindow::parseData()
{
    QByteArray readed = process.readAllStandardOutput();
    QString text = QString::fromLocal8Bit(readed);
    QStringList lines = text.split("\r\n");
    QString newLine = lines[lines.size()-2];
    QStringList parsed = newLine.split(' ');

    switch (parsed[0].toInt()) {
    case 0:
        points[0].setX(parsed[1].toInt());
        points[0].setY(parsed[2].toInt());
        break;
    case 1:
        points[1].setX(parsed[1].toInt());
        points[1].setY(parsed[2].toInt());
    case 2:
        points[2].setX(parsed[1].toInt());
        points[2].setY(parsed[2].toInt());
    case 3:
        points[3].setX(parsed[1].toInt());
        points[3].setY(parsed[2].toInt());
    default:
        break;
    }
    update();
}

 

Revise this Paste

Your Name: Code Language: