Пример #1
0
void Connection::readSocket()
{
    QByteArray block = conection->readAll();
    QDataStream in(&block, QIODevice::ReadOnly);
    in.setVersion(QDataStream::Qt_5_0);
    while (!in.atEnd())
    {
        QByteArray p;
        in >> p;
        QJsonDocument j_doc = QJsonDocument::fromJson(p);
        qDebug() << j_doc.toJson(QJsonDocument::Compact);
        emit ReadReady(j_doc.object());
    }
}
Пример #2
0
void MockSinkWithSignal::HandleData(const QByteArray& data, ISender *from)
{
    MockSink::HandleData(data, from);
    emit ReadReady(this);
}