2017-03-27 16:38:42 +02:00
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
|
#include <QLibrary>
|
2017-04-05 13:04:13 +02:00
|
|
|
|
#include <QModelIndex>
|
2017-03-25 18:44:26 +01:00
|
|
|
|
#include <QQmlApplicationEngine>
|
2017-04-05 13:04:13 +02:00
|
|
|
|
#include <QQmlContext>
|
2017-03-25 18:44:26 +01:00
|
|
|
|
#include <QQuickView>
|
2017-03-27 15:38:25 +02:00
|
|
|
|
#include <QScreen>
|
|
|
|
|
#include <QUrl>
|
2017-04-05 13:04:13 +02:00
|
|
|
|
#include <QVariant>
|
2017-03-27 16:38:42 +02:00
|
|
|
|
#include <QWindow>
|
|
|
|
|
#include <qt_windows.h>
|
2017-03-25 18:44:26 +01:00
|
|
|
|
|
2017-04-03 18:48:34 +02:00
|
|
|
|
#include "installedlistmodel.h"
|
2017-04-05 13:04:13 +02:00
|
|
|
|
#include "screenplay.h"
|
2017-04-06 23:12:58 +02:00
|
|
|
|
#include "mainwindow.h"
|
2017-03-25 18:44:26 +01:00
|
|
|
|
|
2017-03-27 16:38:42 +02:00
|
|
|
|
int main(int argc, char* argv[])
|
2017-03-25 18:44:26 +01:00
|
|
|
|
{
|
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
2017-03-27 16:38:42 +02:00
|
|
|
|
QCoreApplication::setOrganizationName("Aimber");
|
|
|
|
|
QCoreApplication::setOrganizationDomain("aimber.net");
|
|
|
|
|
QCoreApplication::setApplicationName("ScreenPlay");
|
2017-03-27 15:38:25 +02:00
|
|
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
|
|
2017-04-03 18:48:34 +02:00
|
|
|
|
InstalledListModel ilm;
|
|
|
|
|
|
|
|
|
|
QQmlApplicationEngine mainWindow;
|
|
|
|
|
mainWindow.rootContext()->setContextProperty("installedListModel", &ilm);
|
|
|
|
|
mainWindow.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
|
|
|
|
|
|
2017-04-06 23:12:58 +02:00
|
|
|
|
|
|
|
|
|
ScreenPlay sp(GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN));
|
|
|
|
|
sp.context()->setContextProperty("installedListModel",&ilm);
|
|
|
|
|
sp.loadQQuickView(QUrl(QStringLiteral("qrc:/qml/Components/ScreenPlay.qml")));
|
|
|
|
|
sp.showQQuickView(GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN));
|
|
|
|
|
|
|
|
|
|
QObject::connect(&ilm, &InstalledListModel::setScreenVisible,
|
|
|
|
|
&sp,&ScreenPlay::setVisible);
|
|
|
|
|
|
2017-03-27 15:38:25 +02:00
|
|
|
|
|
2017-04-03 18:48:34 +02:00
|
|
|
|
int status = app.exec();
|
|
|
|
|
|
|
|
|
|
//Shutdown
|
2017-04-05 13:04:13 +02:00
|
|
|
|
return status;
|
2017-03-25 18:44:26 +01:00
|
|
|
|
}
|