Hello everyone,
I have a vector of simple structs[1] that I have to write into several txt depending of the datamember _datatype_. I'll call this vector the structvector.
To do this I've thought I'll open a QTextStream for each file and then traverse the structvector and write to the correspondant stream.
Since the number of datatypes is not known (althought <= 6), I've thought I'd store each stream on a container.
The problem is, I can't find a way to correctly store and manage a QTextStream memory. I've tried with a map and vector using different types T:
unique_ptr<QTextStream>
unique_ptr<QTextStream>
To copy to clipboard, switch view to plain text mode
,
QTextStream* = new QTextStream
To copy to clipboard, switch view to plain text mode
and
QTextStream
To copy to clipboard, switch view to plain text mode
. The first complains with "cannot delete incomplete type", the second segfaults on the delete and the latter complains that Copy is private on QTextStream.
Hoe am I supposed to store QTextStreams in a container? Would you approach this differently?
[1] { QString datatype; int count; double timestamp; }
Bookmarks