Thanks, All. But I think spirit is basic right. It has nothing to do with if the RegExp is correct. The real problem is hierarchical data model. I need to subclass QSortFilterProxyModel to do something concerning "source_parent":

Qt Code:
  1. class MySortFilterProxyModel : public QSortFilterProxyModel
  2. {
  3. protected:
  4. virtual bool MySortFilterProxyModel::filterAcceptsRow(
  5. int source_row, const QModelIndex &source_parent) const{
  6. QFileSystemModel *sm = qobject_cast<QFileSystemModel*>(sourceModel());
  7. if (source_parent == sm->index(sm->rootPath())) {
  8. return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
  9. }
  10. return true;
  11. }
  12. };
To copy to clipboard, switch view to plain text mode 
This works fine for me.