QSortFilterProxyModel が QFileSystemModel で動作する場合、正しくフィルタリングできないことがわかりました。ビューに何も残らないこともありました。誰かが私が間違っている場所を指摘できますか?
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QFileSystemModel>
#include <QSortFilterProxyModel>
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QFileSystemModel *fsm = new QFileSystemModel(this);
    fsm->setRootPath(".");
    QSortFilterProxyModel *sfpm = new QSortFilterProxyModel();
    sfpm->setDynamicSortFilter(true);
    sfpm->setSourceModel(fsm);
    ui->tableView->setModel(sfpm);
    ui->tableView->setRootIndex(sfpm->mapFromSource(fsm->index(".")));
    sfpm->setFilterRegExp(QRegExp(".*cpp"));
    sfpm->setFilterKeyColumn(0);
}
MainWindow::~MainWindow()
{
    delete ui;
}
上記のコードで QRegExp(".*") を使用すると、現在のパスにあるすべてのファイルが表示されます。これをテストするための簡単なプロジェクトを作成できます。