mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-28 17:28:14 +08:00
8f30948105
(profiler_gui) Moving sources into separate files; (profiler_gui) Rename Prof* classes into Easy*; (EasyGraphicsView) Optimized performance by not painting items which were not expanded in TreeWidget. While there are no range selected for TreeWidget, only top-level blocks are painted on scene.
45 lines
1005 B
C++
45 lines
1005 B
C++
#include <QApplication>
|
|
#include <QTreeView>
|
|
#include <QFileSystemModel>
|
|
#include <chrono>
|
|
//#include "treemodel.h"
|
|
#include "main_window.h"
|
|
#include "profiler/reader.h"
|
|
|
|
//#ifdef WIN32
|
|
//#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
|
|
//#endif
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
QApplication app(argc, argv);
|
|
|
|
//QFileSystemModel *model = new QFileSystemModel;
|
|
//model->setRootPath(QDir::currentPath());
|
|
// const char* filename = 0;
|
|
// if(argc > 1 && argv[1]){
|
|
// filename = argv[1];
|
|
// }else{
|
|
// return 255;
|
|
// }
|
|
|
|
// QFile file(filename);
|
|
// file.open(QIODevice::ReadOnly);
|
|
// TreeModel model(file.readAll());
|
|
// file.close();
|
|
|
|
|
|
// QTreeView *tree = new QTreeView();
|
|
// tree->setModel(&model);
|
|
//
|
|
// tree->show();
|
|
|
|
auto now = ::std::chrono::duration_cast<std::chrono::seconds>(::std::chrono::system_clock::now().time_since_epoch()).count() >> 1;
|
|
srand((unsigned int)now);
|
|
|
|
EasyMainWindow window;
|
|
window.show();
|
|
|
|
return app.exec();
|
|
}
|