There is more to come
It seems that if I try to assign QByteArray to the QTextStream QT is once again using the IODevice::ReadOnly constructor. How can I assign QByteArray to the QTextStream in ReadWrite mode? Threre should be one according to the documentation
array.append(buffer);
out << "hello";
out >> string; // == "test"
QString buffer = "test";
QByteArray array;
array.append(buffer);
QTextStream out(&array,QIODevice::ReadWrite);
out << "hello";
QString string;
out >> string; // == "test"
To copy to clipboard, switch view to plain text mode
I even get similar problems when using IODevices:
if (!file.open()) //will always be opened in QIODevice::ReadWrite mode
return;
inOut << "hello";
inOut >> s; // == ""
QTemporaryFile file("test");
if (!file.open()) //will always be opened in QIODevice::ReadWrite mode
return;
QTextStream inOut(&file);
inOut << "hello";
QString s;
inOut >> s; // == ""
To copy to clipboard, switch view to plain text mode
What am I missing here?
Bookmarks