2019-01-05 16:49:35 +03:00
|
|
|
#ifdef QT_QML_DEBUG
|
|
|
|
#include <QtQuick>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <sailfishapp.h>
|
|
|
|
|
2019-01-05 18:15:32 +03:00
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlContext>
|
|
|
|
#include <QQuickView>
|
|
|
|
#include <QQmlEngine>
|
|
|
|
|
|
|
|
#include "battery.h"
|
|
|
|
|
2019-01-05 16:49:35 +03:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
// SailfishApp::main() will display "qml/harbour-batterybuddy.qml", if you need more
|
|
|
|
// control over initialization, you can use:
|
|
|
|
//
|
|
|
|
// - SailfishApp::application(int, char *[]) to get the QGuiApplication *
|
|
|
|
// - SailfishApp::createView() to get a new QQuickView * instance
|
|
|
|
// - SailfishApp::pathTo(QString) to get a QUrl to a resource file
|
|
|
|
// - SailfishApp::pathToMainQml() to get a QUrl to the main QML file
|
|
|
|
//
|
|
|
|
// To display the view, call "show()" (will show fullscreen on device).
|
|
|
|
|
2019-01-05 18:15:32 +03:00
|
|
|
QGuiApplication* app = SailfishApp::application(argc, argv);
|
|
|
|
QQuickView* view = SailfishApp::createView();
|
|
|
|
|
|
|
|
Battery battery;
|
|
|
|
view->engine()->addImportPath("/usr/share/harbour-carbudget/qml");
|
|
|
|
view->rootContext()->setContextProperty("battery", &battery);
|
|
|
|
view->setSource(SailfishApp::pathTo("qml/harbour-batterybuddy.qml"));
|
|
|
|
view->showFullScreen();
|
|
|
|
|
|
|
|
return app->exec();
|
2019-01-05 16:49:35 +03:00
|
|
|
}
|