您的位置:首页 > 其它

QHash

2016-12-17 18:45 225 查看
#include <QCoreApplication>
#include<QHash>
#include<QDebug>

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QHash<int,QString> Employees;
Employees.insert(1,"Bob");
Employees.insert(2,"Cat");
Employees.insert(3,"Boat");
Employees.insertMulti(1,"mmm");

qDebug()<<"3    " << Employees.value(3);

//    foreach(int i, Employees.keys())
//    {
//        qDebug() << Employees[i];
//    }

//    QHashIterator<int,QString> Iter(Employees);
//    while(Iter.hasNext())
//       {
//        Iter.next();
//        qDebug() << Iter.key()<<" "<<Iter.value();
//    }

return a.exec();
}


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: