Fix UI to work better on smaller screens. Implement first version of data import from carfax json.

This commit is contained in:
2020-06-16 17:24:40 -04:00
parent 62c8b37bd8
commit b8928230bd
7 changed files with 65 additions and 26 deletions

View File

@@ -30,6 +30,7 @@
#include <QQmlContext>
#include "db/sqlvehicle.h"
#include "db/sqlservicerecord.h"
#include "jsonio.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
@@ -75,11 +76,13 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
//Fill model with inital data.
vehicles.select();
records.select();
JsonIO converter(&vehicles, &records);
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.load(QUrl(QStringLiteral("qrc:///main.qml")));
if (engine.rootObjects().isEmpty()) {