main.cpp 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /************************************************************************
  2. * file name : main.cpp
  3. * ----------------- :
  4. * creation time : 2016/04/29
  5. * authors : Sergey Yagovtsev, Victor Zarubkin
  6. * email : [email protected], [email protected]
  7. * ----------------- :
  8. * description : Main file for EasyProfiler GUI.
  9. * ----------------- :
  10. * license : Lightweight profiler library for c++
  11. * : Copyright(C) 2016-2017 Sergey Yagovtsev, Victor Zarubkin
  12. * :
  13. * : Licensed under either of
  14. * : * MIT license (LICENSE.MIT or http://opensource.org/licenses/MIT)
  15. * : * Apache License, Version 2.0, (LICENSE.APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  16. * : at your option.
  17. * :
  18. * : The MIT License
  19. * :
  20. * : Permission is hereby granted, free of charge, to any person obtaining a copy
  21. * : of this software and associated documentation files (the "Software"), to deal
  22. * : in the Software without restriction, including without limitation the rights
  23. * : to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  24. * : of the Software, and to permit persons to whom the Software is furnished
  25. * : to do so, subject to the following conditions:
  26. * :
  27. * : The above copyright notice and this permission notice shall be included in all
  28. * : copies or substantial portions of the Software.
  29. * :
  30. * : THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  31. * : INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  32. * : PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  33. * : LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  34. * : TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  35. * : USE OR OTHER DEALINGS IN THE SOFTWARE.
  36. * :
  37. * : The Apache License, Version 2.0 (the "License")
  38. * :
  39. * : You may not use this file except in compliance with the License.
  40. * : You may obtain a copy of the License at
  41. * :
  42. * : http://www.apache.org/licenses/LICENSE-2.0
  43. * :
  44. * : Unless required by applicable law or agreed to in writing, software
  45. * : distributed under the License is distributed on an "AS IS" BASIS,
  46. * : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  47. * : See the License for the specific language governing permissions and
  48. * : limitations under the License.
  49. ************************************************************************/
  50. #include <chrono>
  51. #include <QApplication>
  52. #include "main_window.h"
  53. #include <easy/reader.h>
  54. #if defined(_WIN32) && defined (_BUILD_RELEASE_)
  55. #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
  56. #endif
  57. int main(int argc, char **argv)
  58. {
  59. QApplication app(argc, argv);
  60. //QFileSystemModel *model = new QFileSystemModel;
  61. //model->setRootPath(QDir::currentPath());
  62. // const char* filename = 0;
  63. // if(argc > 1 && argv[1]){
  64. // filename = argv[1];
  65. // }else{
  66. // return 255;
  67. // }
  68. // QFile file(filename);
  69. // file.open(QIODevice::ReadOnly);
  70. // TreeModel model(file.readAll());
  71. // file.close();
  72. // QTreeView *tree = new QTreeView();
  73. // tree->setModel(&model);
  74. //
  75. // tree->show();
  76. auto now = ::std::chrono::duration_cast<std::chrono::seconds>(::std::chrono::system_clock::now().time_since_epoch()).count() >> 1;
  77. srand((unsigned int)now);
  78. EasyMainWindow window;
  79. window.show();
  80. return app.exec();
  81. }