-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
29 lines (22 loc) · 836 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <QCoreApplication>
#include <QGuiApplication>
#include <QQuickView>
#include <QString>
#include <QUrl>
#include "src/plantsimageprovider.hpp"
#include "src/plantsmodel.hpp"
int main(int argc, char* argv[])
{
QCoreApplication::setOrganizationName("plants.s710");
QCoreApplication::setApplicationName("plants.s710");
QGuiApplication* app = new QGuiApplication(argc, (char**)argv);
app->setApplicationName("plants.s710");
qmlRegisterType<plants::PlantsModel>("PlantsModel", 1, 0, "PlantsModel");
QQuickView* view = new QQuickView();
QQmlEngine* engine = view->engine();
engine->addImageProvider(QLatin1String("plants"), new plants::PlantsImageProvider());
view->setSource(QUrl("qrc:/Main.qml"));
view->setResizeMode(QQuickView::SizeRootObjectToView);
view->show();
return app->exec();
}