문제

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