application.hpp 519 B

123456789101112131415161718192021222324252627
  1. #ifndef APPLICATION_H
  2. #define APPLICATION_H
  3. #include "API.h"
  4. class Application {
  5. // QML
  6. QGuiApplication app;
  7. QQmlApplicationEngine engine;
  8. API api;
  9. struct AppIniter {
  10. std::string database_path;
  11. };
  12. // Init
  13. void initQML(const QUrl qml_url);
  14. AppIniter processArgs(int argc, char* argv[]);
  15. Application(AppIniter app_initer, int argc, char* argv[], QUrl qml_url);
  16. public:
  17. Application(int argc, char* argv[], QUrl qml_url);
  18. int start();
  19. };
  20. #endif // APPLICATION_H