qSort()
qCopy()
qFill()
#include <QCoreApplication> #include<QDebug> #include<QVector> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QVector<QString>Vect(5); qFill(Vect.begin()+1,Vect.end()-2,"Hello wordl"); foreach(QString itm,Vect) { qDebug() << itm; } return a.exec(); }
qFind()
#include <QCoreApplication> #include<QDebug> #include<QVector> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QList<int>List; List << 1<<5<<15<<23; QList<int>::const_iterator iter = qFind(List.begin(),List.end(),55); if(iter != List.end()) { qDebug()<<"Found: "<<*iter; } else { qDebug() <<"No"; } return a.exec(); }