I\'ve a QMap
object and I am trying to write its content to a file.
QMap extensions;
//..
for(auto e : extensions)
{
fou
In "old" C++, using Qt, you would do it like this:
QMap< QString, whatever > extensions;
//...
foreach( QString key, extensions.keys() )
{
fout << key << "," << extensions.value( key ) << '\n';
}
I don't have a C++11 compiler here but maybe the following will work:
for( auto key: extensions.keys() )
{
fout << key << "," << extensions.value( key ) << '\n';
}
You can also use iterators instead, check out hmuelners link if you prefer using them