PDA

View Full Version : Problem with QDirIterator



LaurentDuroisin
5th January 2016, 10:38
Hi, I want to list all txt files of a directory to find one, but, the framework only list one file.
The comparaison also doens't work.

Here's my code :



//Je n'ai qu'un seul fichier!
for (unsigned int i = 0; i < fileList.size(); i++) {
QString text = qleRechercher->text();
//std::cout<<text.toStdString()<<" "<<qleRechercher->text().toStdString();
//widget2 n'a pas de layout, pourtant, il me dit qu'il en a un.
QVBoxLayout* qvb = new QVBoxLayout(widget2);
//Ne fonctionne pas.
if (text == fileList.at(i)) {
QCheckBox* qcb = new QCheckBox(text);
qvb->addWidget(qcb);
}
}


Thanks.

anda_skoa
5th January 2016, 12:24
So what exactly is not working? I.e. what do you expect to see and what happens instead?

Cheers,
_