Question

Well i have a QIODevice where i want to store data. But have issues with it. Everytime i try to create one i get errors.

QIODevice dev;
dev.open(QIODevice::ReadWrite);
dev.write(md);
dev.close();

What i just want to store is a QByteArray (where you can use it with write(QByteArray) and then use it later.

Any idea?

The error is "cannot declare variable dev of abstract type 'QIODevice'".

Était-ce utile?

La solution

You cannot declare variable of abstract type)). QIODevice is abstract. If you wanna use it you have to look at one of Q3Socket, Q3SocketDevice, QAbstractSocket, QBuffer, QFile, QLocalSocket, QNetworkReply, and QProcess.

I think best way for use is using QByteArray only.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top