![](https://i-blog.csdnimg.cn/blog_migrate/d46a9e5c23939a01ba4b8b6df48dfdd4.png)
1.UI界面使用treeView控件,再在treeview上显示pdf文件
void MainWindow::init()
{
appPath=QCoreApplication::applicationDirPath();//首先在头文件中把appPath定义为全局变量(.exe文件所在路径)
model = new QFileSystemModel();
model->setRootPath(appPath);
filePath=appPath+"/studyFile";//所要展示的pdf文件所在文件夹
ui->treeView->setModel(model);