|
竞风 发表于 2013-6-27 10:24
用QTreeWidget做出来了,用递归的方法使用QDIR::entryInfoList函数找到每个文件夹中符合要求的文件。用QTre ...
嗯。最简单的就这样用:
#include <QApplication>
#include <QFileSystemModel>
#include <QTreeView>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QFileSystemModel model;
model.setRootPath("");
QTreeView tree;
tree.setModel(&model);
// Demonstrating look and feel features
tree.setAnimated(false);
tree.setIndentation(20);
tree.setSortingEnabled(true);
tree.setWindowTitle(QObject::tr("Dir View"));
tree.resize(640, 480);
tree.show();
return app.exec();
}
|
|