QSharedMemory *sm = new QSharedMemory("key", this);
if(sm->create(1024))
{
ba->setRawData((char*)sm->data(), sm->size());
connect(buff, SIGNAL(readyRead()), this, SLOT(bufferReadyRead()));
memset(sm->data(), NULL, sm->size());
sm->lock();
memcpy((char*)sm->data(), response.data(), sm->size()-1);
buff->close();
// Here I want the QBuffer's readyRead() signal to emit
sm->unlock();
}
QSharedMemory *sm = new QSharedMemory("key", this);
QByteArray *ba;
QBuffer *buff;
if(sm->create(1024))
{
ba = new QByteArray();
ba->setRawData((char*)sm->data(), sm->size());
buff = new QBuffer(ba, this);
connect(buff, SIGNAL(readyRead()), this, SLOT(bufferReadyRead()));
memset(sm->data(), NULL, sm->size());
QByteArray response = myDomDoc.toByteArray();
sm->lock();
buff->open(QIODevice::ReadWrite);
memcpy((char*)sm->data(), response.data(), sm->size()-1);
buff->close();
// Here I want the QBuffer's readyRead() signal to emit
sm->unlock();
}
To copy to clipboard, switch view to plain text mode
Bookmarks