So this works when I don't use a QSortFilterProxyModel but when I make QTreeView use a QSortFilterProxyModel, the compiled code seg faults...

Qt Code:
  1. QTreeView *treeView = new QTreeView();
  2. QDirModel *dirModel = new QDirModel();
  3.  
  4. proxyDirModel->setSourceModel(dirModel);
  5. treeView->setModel(proxyDirModel);
  6.  
  7. // I have tried it both of these ways:
  8. treeView->setRootIndex(dirModel->index("/"));
  9. //treeView->setRootIndex(treeProxyModel->sourceModel()->index("/"));
To copy to clipboard, switch view to plain text mode 

How can I make this work? Right now it seems like having two QDirModels works without problems when I use one dirmodel and try to do this the right way I run into lots of problems and not a lot of good documentation...