Initial UI
This commit is contained in:
1 parent
4d52c8cc60
commit
3c0037cfc9
29 files changed
+1367
-2
No files matched your search
@@ -0,0 +1,42 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include "backend/BookController.h"
|
||||
#include "backend/ReadingModel.h"
|
||||
#include "backend/BookmarkModel.h"
|
||||
#include "backend/BookmarkStore.h"
|
||||
#include "backend/AppState.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
app.setApplicationName(QStringLiteral("Asteria"));
|
||||
app.setOrganizationName(QStringLiteral("Asteria"));
|
||||
|
||||
BookmarkStore bookmarkStore;
|
||||
ReadingModel readingModel;
|
||||
BookmarkModel bookmarkModel;
|
||||
bookmarkModel.setStore(&bookmarkStore);
|
||||
|
||||
BookController bookController;
|
||||
bookController.setReadingModel(&readingModel);
|
||||
bookController.setBookmarkModel(&bookmarkModel);
|
||||
|
||||
AppState appState;
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
engine.rootContext()->setContextProperty(QStringLiteral("bookController"), &bookController);
|
||||
engine.rootContext()->setContextProperty(QStringLiteral("readingModel"), &readingModel);
|
||||
engine.rootContext()->setContextProperty(QStringLiteral("bookmarkModel"), &bookmarkModel);
|
||||
engine.rootContext()->setContextProperty(QStringLiteral("appState"), &appState);
|
||||
|
||||
const QUrl url(QStringLiteral("qrc:/Asteria/Main.qml"));
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
|
||||
&app, []() { QCoreApplication::exit(-1); },
|
||||
Qt::QueuedConnection);
|
||||
engine.load(url);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
Reference in new issue
Block a user