The docs say:You have to use a different constructor to create an RW stream:QTextStream::QTextStream ( const QByteArray & array, QIODevice::OpenMode openMode = QIODevice::ReadOnly )
Constructs a QTextStream that operates on array, using openMode to define the open mode. The array is accessed as read-only, regardless of the values in openMode.Qt Code:
out << "hello"; QString string; out >> string; // == "testhello"To copy to clipboard, switch view to plain text mode
If you just want to append a string use QString::operator+() or QString::append().




Reply With Quote
Bookmarks