Writing data of type QVector<QVector<QString>> into a text file
Solved
General and Desktop
-
Hi Guys,
I want to write some data into text file.
My data type isQVector<QVector<QString>>table;
but I am getting an error
no match for 'operator<<' (operand types are 'QTextStream' and 'QVector<QVector<QString> >')
out << table; ~~~~^~~~~~~~~~~~~~
How can I write this data to a file?
-
I just have to add to @KroMignon, if
table
is notconst
, you should useqAsConst
:for(const auto &v : qAsConst(table)) { for(const auto &str : v) out << str; }