qmlFrontend/main.cpp
author unc0rr
Wed, 08 Apr 2015 23:39:18 +0300
branchqmlfrontend
changeset 10888 a04e04aaf599
parent 10886 99273b7afbff
permissions -rw-r--r--
Ammo schemes list, almost works
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     1
#include <QtGui/QGuiApplication>
10420
unc0rr
parents: 10402
diff changeset
     2
#include <QQmlEngine>
unc0rr
parents: 10402
diff changeset
     3
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     4
#include "qtquick2applicationviewer/qtquick2applicationviewer.h"
10420
unc0rr
parents: 10402
diff changeset
     5
#include "hwengine.h"
unc0rr
parents: 10402
diff changeset
     6
#include "previewimageprovider.h"
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10420
diff changeset
     7
#include "themeiconprovider.h"
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     8
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
     9
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    10
int main(int argc, char *argv[])
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    11
{
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    12
    QGuiApplication app(argc, argv);
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    13
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    14
    HWEngine::exposeToQML();
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    15
10886
99273b7afbff - Merge default
unc0rr
parents: 10436
diff changeset
    16
    Q_INIT_RESOURCE(qmlFrontend);
99273b7afbff - Merge default
unc0rr
parents: 10436
diff changeset
    17
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    18
    QtQuick2ApplicationViewer viewer;
10420
unc0rr
parents: 10402
diff changeset
    19
unc0rr
parents: 10402
diff changeset
    20
    viewer.engine()->addImageProvider(QLatin1String("preview"), new PreviewImageProvider());
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10420
diff changeset
    21
    viewer.engine()->addImageProvider(QLatin1String("theme"), new ThemeIconProvider());
10420
unc0rr
parents: 10402
diff changeset
    22
10886
99273b7afbff - Merge default
unc0rr
parents: 10436
diff changeset
    23
    viewer.setSource(QUrl("qrc:/qml/qmlFrontend/main.qml"));
10402
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    24
    viewer.showExpanded();
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    25
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    26
    return app.exec();
3313336c1ee0 Let's get it started
unc0rr
parents:
diff changeset
    27
}