your problem clearly has nothing to do with the issue at hand but with basic C++ syntax, and with it probably C++ in general.
All of the code snippets you posted show that you are not aware that you need a *variable* declared of the type you want.
I assume that the three code snippets are a try to make a QTextSream object a member of a class? I am can only guess as you gave no further details.
unique_ptr<QTextStream> uniqueStream
(new QTextStream());
unique_ptr<QTextStream> uniqueStream(new QTextStream());
To copy to clipboard, switch view to plain text mode
QTextStream* pTextStream = new QTextStream();
To copy to clipboard, switch view to plain text mode
QTextStream textStream;
To copy to clipboard, switch view to plain text mode
Please read the QTextStream docs, there are some code snippets there to help you out.
http://doc.qt.io/qt-5/qtextstream.html
oe am I supposed to store QTextStreams in a container? Would you approach this differently?
No need to store the stream anywhere.
Simply have a function or a method that takes a struct and the destination as parameters, and in it use a stream to stream you struct.
However, all I did here was to give you a fish. (if at all)
It is very probable you will get stuck at the next trivial problem.
You really fist should learn some basic C++, and then return to this problem.
Bookmarks