1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

Merge branch '62-remove-support-for-qt-5-14' into 'dev'

Resolve "Remove support for Qt < 5.14"

Closes #62

See merge request kelteseth/ScreenPlay!19
This commit is contained in:
Elias Steurer (Kelteseth) 2020-02-15 17:07:37 +00:00
commit 27c768526b
4 changed files with 4 additions and 33 deletions

View File

@ -109,7 +109,6 @@ App::App()
// Init after we have the paths from settings
m_installedListModel->init();
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
// Set visible if the -silent parameter was not set
if (QGuiApplication::instance()->arguments().contains("-silent")) {
settings()->setSilentStart(true);
@ -118,8 +117,6 @@ App::App()
qmlRegisterSingletonInstance("ScreenPlay", 1, 0, "ScreenPlay", this);
m_mainWindowEngine = make_unique<QQmlApplicationEngine>();
m_mainWindowEngine->load(QUrl(QStringLiteral("qrc:/main.qml")));
#endif
}
void App::exit()

View File

@ -53,13 +53,6 @@ class App : public QObject {
public:
explicit App();
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
static App* instance()
{
static App app;
return &app;
}
#endif
GlobalVariables* globalVariables() const
{
return m_globalVariables.get();
@ -236,9 +229,7 @@ public slots:
}
private:
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
unique_ptr<QQmlApplicationEngine> m_mainWindowEngine;
#endif
unique_ptr<Create> m_create;
unique_ptr<ScreenPlayManager> m_screenPlayManager;

View File

@ -9,24 +9,7 @@ int main(int argc, char* argv[])
QGuiApplication qtGuiApp(argc, argv);
using namespace ScreenPlay;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterSingletonType<App>("ScreenPlay", 1, 0, "ScreenPlay", [](QQmlEngine* engine, QJSEngine*) -> QObject* {
engine->setObjectOwnership(App::instance(), QQmlEngine::ObjectOwnership::CppOwnership);
return App::instance();
});
QQmlApplicationEngine m_mainWindowEngine;
m_mainWindowEngine.load(QUrl(QStringLiteral("qrc:/main.qml")));
// Set visible if the -silent parameter was not set
if (QGuiApplication::instance()->arguments().contains("-silent")) {
App::instance()->settings()->setSilentStart(true);
}
#else
App app;
#endif
ScreenPlay::App app;
return qtGuiApp.exec();
}

View File

@ -38,9 +38,9 @@ int main(int argc, char* argv[])
//Set the monitor number to test
#if defined(Q_OS_WIN)
WinWindow window1({ 0 }, "test", "appid", "1", "fill");
WinWindow window2({ 1 }, "test", "appid", "1", "fill");
WinWindow window3({ 2 }, "test", "appid", "1", "fill");
//WinWindow window1({ 0 }, "test", "appid", "1", "fill");
//WinWindow window2({ 1 }, "test", "appid", "1", "fill");
//WinWindow window3({ 2 }, "test", "appid", "1", "fill");
WinWindow window({ 0 }, "C:/Program Files (x86)/Steam/steamapps/workshop/content/672870/1954178242", "appid", "1", "fill", true);
#endif