From 6d78a28a7103975841564b5606fe5ac076dd7ce6 Mon Sep 17 00:00:00 2001 From: Tim Süberkrüb Date: Sat, 28 Nov 2015 13:21:11 +0100 Subject: Initial commit --- src/main.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/src.pri | 2 ++ 2 files changed, 48 insertions(+) create mode 100755 src/main.cpp create mode 100755 src/src.pri (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp new file mode 100755 index 0000000..ec8f2de --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,46 @@ +// Copyright © 2015 Florent Revest +// This work is free. You can redistribute it and/or modify it under the +// terms of the Do What The Fuck You Want To Public License, Version 2, +// as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. + +#include +#include +#include +#include + +#ifndef QT_NO_WIDGETS +#include +#else +#include +#endif + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_WIDGETS +#define Application QApplication +#else +#define Application QGuiApplication +#endif + +int main(int argc, char *argv[]) +{ + Application app(argc, argv); + QScreen* sc = app.primaryScreen(); + if(sc){ + sc->setOrientationUpdateMask(Qt::LandscapeOrientation + | Qt::PortraitOrientation + | Qt::InvertedLandscapeOrientation + | Qt::InvertedPortraitOrientation); + } + QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); + QObject *topLevel = engine.rootObjects().value(0); + QQuickWindow *window = qobject_cast(topLevel); + if ( !window ) { + qWarning("Error: Your root item has to be a Window."); + return -1; + } + window->showFullScreen(); + return app.exec(); +} + +QT_END_NAMESPACE diff --git a/src/src.pri b/src/src.pri new file mode 100755 index 0000000..66d903e --- /dev/null +++ b/src/src.pri @@ -0,0 +1,2 @@ +SOURCES += \ + $$PWD/main.cpp -- cgit v1.2.3-70-g09d2