This repository was archived by the owner on Nov 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (42 loc) · 1.4 KB
/
main.cpp
File metadata and controls
54 lines (42 loc) · 1.4 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
43
44
45
46
47
48
49
50
51
52
53
54
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QTranslator>
#include <QLocale>
#include <QQuickStyle>
//news section
#include <QtWebView/QtWebView>
//wallpaper section
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include "wallpaper/filesystem.h"
#include "wallpaper/unsplash.h"
#include "wallpaper/photo.h"
#include "wallpaper/photolist.h"
#include "wallpaper/localphotolist.h"
#include <Magick++.h>
using namespace Magick;
int main(int argc, char *argv[])
{
//settings for wallpaper part
InitializeMagick(*argv);
QtWebView::initialize();
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QGuiApplication app(argc, argv);
FileSystem::init();
QQuickStyle::setStyle("Material");
QTranslator appTranslator;
appTranslator.load(":/lang/croeso_" +
QLocale::system().name());
app.installTranslator(&appTranslator);
// Register C++ class in QML
qmlRegisterType<Unsplash>("Unwallpaper", 1, 0, "Unsplash");
qmlRegisterType<Photo>("Unwallpaper", 1, 0, "PhotoModel");
qmlRegisterType<PhotoList>("Unwallpaper", 1, 0, "PhotoListModel");
qmlRegisterType<LocalPhotoList>("Unwallpaper", 1, 0, "LocalPhotoListModel");
QQmlApplicationEngine engine;
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}