QMap

 

1.QMap

 

QMap<QString,QString> productMap
productMap["name"]="orange";
productMap["nubmer"]="12345";

 

 QMap<QString,QString>::iterator it; //遍历map
    for( it = productMap.begin(); it != productMap.end(); ++it )
    {
       sqlFields=sqlFields+it.key()+",";
       sqlValues=sqlValues+"'"+it.value()+"',";
    }

 

你可能感兴趣的:(QMap)