Iterating over a QMap with for

前端 未结 9 1780
执笔经年
执笔经年 2021-01-31 07:02

I\'ve a QMap object and I am trying to write its content to a file.

QMap extensions;
//.. 

for(auto e : extensions)
{
  fou         


        
9条回答
  •  没有蜡笔的小新
    2021-01-31 07:54

    I used something like this, to achieve my own result. Just in case someone needed the keys and values separately.

    {
       QMap map; 
    
       map.insert(1,"One");
       map.insert(2,"Two");
       map.insert(3,"Three");
       map.insert(4,"Four");   
    
       fout<<"Values in QMap 'map' are:"<

提交回复
热议问题