Nominate our 2022 Qt Champions!

(Solved) Missing icons in QTreeView and QTableView when using QFileSystemModel

  • Hello, everybody!

    I am having simple main window with QTreeView and QTableView embedded in QSplitter. Both QTreeView and QTableView have their own QFileSystemModel. On Mac OS X some icons are missing. This happens almost everytime on OS X 10.7 and somewhat less often on 10.8. Qt version is 5.0.2.
    Please see attached screen shots.
    The code for main window is extremely simple:
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    #include <QDebug>
    #include <QAbstractItemView>

    MainWindow::MainWindow(QWidget *parent) :
    ui(new Ui::MainWindow)
    m_leftModel = new QFileSystemModel(this);
    m_rightModel = new QFileSystemModel(this);
    ui->treeView->setColumnHidden(1, true);
    ui->treeView->setColumnHidden(2, true);
    ui->treeView->setColumnHidden(3, true);
    m_leftModel->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
    connect(ui->treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(onTreeSelectionChanged(QItemSelection,QItemSelection)));

    delete ui;

    void MainWindow::onTreeSelectionChanged(const QItemSelection &selected, const QItemSelection &)
    QModelIndex index =;

    I don't believe that I did something wrong. Does anybody had any similar issues on OS X? Should I file a bug or I am missing something obvious here?

  • I've just checked with obsolete QDirModel instead of QFileSystemModel. The problem persists.

  • I've filed a bug, and the developers are already working on this. Thanks, guys!

    Here is the link to the "bug":

Log in to reply