0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 17:28:14 +08:00

33 lines
580 B
C++
Raw Normal View History

2016-04-29 16:13:32 +03:00
#include <QApplication>
#include <QTreeView>
#include <QFileSystemModel>
2016-05-01 23:32:46 +03:00
#include "treemodel.h"
2016-04-29 16:13:32 +03:00
int main(int argc, char **argv)
{
QApplication app(argc, argv);
2016-05-01 23:32:46 +03:00
//QFileSystemModel *model = new QFileSystemModel;
//model->setRootPath(QDir::currentPath());
2016-06-10 23:45:21 +03:00
const char* filename = 0;
if(argc > 1 && argv[1]){
filename = argv[1];
}else{
return 255;
}
QFile file(filename);
2016-05-01 23:32:46 +03:00
file.open(QIODevice::ReadOnly);
TreeModel model(file.readAll());
file.close();
2016-04-29 16:13:32 +03:00
QTreeView *tree = new QTreeView();
2016-05-01 23:32:46 +03:00
tree->setModel(&model);
2016-04-29 16:13:32 +03:00
tree->show();
2016-05-01 23:32:46 +03:00
return app.exec( );
}