I'm printing the filenames in textBrowser_filename
. But on commenting the snippet which prints the filename in textBrowser it runs smoothly. So is there any upper limit of text which can be printed/stored inside the textBrowser in Qtcreator?
following is the code which runs smoothly but not, if comment is removed.
void MainWindow::on_pushButton_browse_clicked()
{
ui->textBrowser_filename->setLineWrapMode(QTextEdit::NoWrap);
ui->textBrowser_filename->setText("");
QString dir= QFileDialog::getExistingDirectory(this, tr("Open Directory"),
"/home",
QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks);
ui->lineEdit_dir->setText(dir);
QDirIterator it(dir, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
/*
while(it.hasNext())
{
QString path=it.fileName();
ui->textBrowser_filename->append(path);
it.next();
}
*/
}
It would be great help if you could help me with another problem which is, why my file name also prints the following(which is commented)?
sample.txt
. //why this is printed
helloWorld.png
.. //why this is printed
thank you!