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'".

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top