This repository was archived by the owner on Feb 16, 2021. It is now read-only.
forked from pinkierton/harkach
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (34 loc) · 1.35 KB
/
main.cpp
File metadata and controls
42 lines (34 loc) · 1.35 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <QGuiApplication>
#include <QQmlEngine>
#include <QQmlComponent>
#include <QQmlContext>
#include <QDebug>
#include <QQuickWindow>
#include "MainApp.h"
#include "Attachment.h"
#include "ThreadsView.h"
#include "PostsView.h"
int main(int argc, char *argv[])
{
qmlRegisterType<BoardModel>("MyLib", 1, 0,"BoardModel");
qmlRegisterType<ThreadModel>("MyLib", 1, 0,"ThreadModel");
qmlRegisterType<Attachment>("MyLib", 1, 0,"Attachment");
qmlRegisterType<ThreadsView>("MyLib", 1, 0,"ThreadsView");
qmlRegisterType<PostsView>("MyLib", 1, 0,"PostsView");
QCoreApplication::setOrganizationName(QLatin1String("HikkaSoft"));
QCoreApplication::setApplicationName(QLatin1String("Sosach"));
QCoreApplication::setApplicationVersion("0.0.1");
QGuiApplication app(argc, argv);
QQmlEngine engine;
QUrl url = QUrl::fromLocalFile(QStringLiteral(PROJECT_ROOT "qml/main.qml"));
QQmlComponent rootComponent(&engine, url);
if (rootComponent.isError()) {
qFatal("%s", qPrintable(rootComponent.errorString()));
}
QQuickWindow *mainWindow = qobject_cast<QQuickWindow*>(rootComponent.beginCreate(engine.rootContext()));
mainWindow->setIcon(QIcon(":/dvlogo.png"));
MainApp *mainApp = new MainApp(mainWindow);
engine.rootContext()->setContextObject(mainApp);
rootComponent.completeCreate();
return app.exec();
}