[SOLVED] Hide inactive files QTreeView

  • Hello guys. I know this is a very discussed problem in internet, but i've tried a lot without success. Here follows my code:

    @dirmodel = new QFileSystemModel(this);

    QStringList filters;
    filters << "*.xml";
    this->ui->treeView->setColumnHidden(1, true);
    this->ui->treeView->setColumnHidden(2, true);
    this->ui->treeView->setColumnHidden(3, true);

    This code was created to show only .xml files in QTreeView. But it only set other extensions as inactive (like image below). How do i hide all this inactive files?


  • Look at the QFileSystemModel::setNameFilterDisables()

  • It works. Thank you. :)

    [quote author="ChrisW67" date="1372146434"]Look at the QFileSystemModel::setNameFilterDisables()[/quote]

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.