Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* FILE NOTES:
- * USE:
- * defines and loads most of the stuff
- * EXPECTATION:
- * Loads stuff like data handler
- */
- //stuff i dont know what is for
- #include <QGuiApplication>
- #include <QQmlApplicationEngine>
- #include <QSettings>
- #include <QString>
- #include <QVariant>
- #include <iostream>
- #include "dataHandler.h"
- data_handler::data_handler(QObject *parent) : QObject(parent) {}
- void data_handler::loadData() {
- QSettings userData("OrganizationName", "ApplicationName");
- //gets all the data
- QVariant list = userData.value("list");
- QVariant points = userData.value("points");
- emit data_handler::response(list.toStringList(),points.toInt());
- }
- void data_handler::saveData(QVector<QString> list, int points) {
- QSettings userData("OrganizationName", "ApplicationName");
- //saves data
- userData.setValue("list",list);
- userData.setValue("points",points);
- }
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
- QQmlApplicationEngine engine;
- const QUrl url(u"qrc:/todover2/Main.qml"_qs);
- QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
- &app, []() { QCoreApplication::exit(-1); },
- Qt::QueuedConnection);
- engine.load(url);
- return app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement