Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Missing icons in QTreeView and QTableView when using QFileSystemModel

$
0
0
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) :   QMainWindow(parent),   ui(new Ui::MainWindow) {   ui->setupUi(this);   m_leftModel = new QFileSystemModel(this);   m_rightModel = new QFileSystemModel(this);   ui->treeView->setModel(m_leftModel);   ui->tableView->setModel(m_rightModel);   ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);   ui->treeView->setColumnHidden(1, true);   ui->treeView->setColumnHidden(2, true);   ui->treeView->setColumnHidden(3, true);   m_leftModel->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);   m_leftModel->setRootPath(QDir::homePath());   m_rightModel->setRootPath(QDir::homePath());   connect(ui->treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(onTreeSelectionChanged(QItemSelection,QItemSelection))); }   MainWindow::~MainWindow() {   delete ui; }   void MainWindow::onTreeSelectionChanged(const QItemSelection &selected, const QItemSelection &) {   QModelIndex index = selected.at(0).indexes().at(0);   ui->tableView->setRootIndex(m_rightModel->index(m_leftModel->filePath(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?

Viewing all articles
Browse latest Browse all 18427

Trending Articles