The snippet I've used is as follows
QDirIterator it(dir, filters, QDir::NoDotAndDotDot | QDir::AllEntries , QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
while(it.hasNext())
{
it.next();
if(QFileInfo(it.filePath()).isFile())
{
QString name=it.fileName();
ui->textBrowser_filename->append(name);
}
}
It goes through all directories and rather than displaying the filename one-by-one, as I said, it displays the contents of textBrowser all-at-once. What's wrong is happening?