Complete oil change logic and connect up to vehicle page.

This commit is contained in:
2020-07-29 10:10:38 -04:00
parent b7e20e3302
commit 369becbf8e
3 changed files with 29 additions and 5 deletions

View File

@@ -32,6 +32,7 @@
#include "db/sqlvehicle.h"
#include "db/sqlservicerecord.h"
#include "jsonio.h"
#include "db/recordanalytics.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
@@ -95,12 +96,14 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
vehicles.select();
records.select();
JsonIO converter(&vehicles, &records);
RecordAnalytics analytics(nullptr, db);
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty(QStringLiteral("appAboutData"), QVariant::fromValue(aboutData));
engine.rootContext()->setContextProperty(QStringLiteral("vehicleModel"), &vehicles);
engine.rootContext()->setContextProperty(QStringLiteral("recordModel"), &records);
engine.rootContext()->setContextProperty(QStringLiteral("jsonConverter"), &converter);
engine.rootContext()->setContextProperty(QStringLiteral("dbAnalytics"), &analytics);
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
if (engine.rootObjects().isEmpty()) {