1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
ScreenPlay/main.cpp

49 lines
1.3 KiB
C++
Raw Normal View History

#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>
#include <QScreen>
#include <QUrl>
2017-04-05 13:04:13 +02:00
#include <QVariant>
#include <QWindow>
#include <qt_windows.h>
2017-03-25 18:44:26 +01: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
int main(int argc, char* argv[])
2017-03-25 18:44:26 +01:00
{
QGuiApplication app(argc, argv);
QCoreApplication::setOrganizationName("Aimber");
QCoreApplication::setOrganizationDomain("aimber.net");
QCoreApplication::setApplicationName("ScreenPlay");
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
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);
int status = app.exec();
//Shutdown
2017-04-05 13:04:13 +02:00
return status;
2017-03-25 18:44:26 +01:00
}