int main(int argc, char** argv) { // Register a new Message Handler for qDebug/qWarning/qCritical/qFatal #ifdef INSTALL_MESSAGE_HANDLER qInstallMsgHandler(messageHandler); #endif // Create the Application QApplication app(argc, argv); app.setApplicationName(APP_NAME); app.setApplicationVersion(APP_VERSION); app.setOrganizationName(ORG_NAME); app.setOrganizationDomain(ORG_DOMAIN); // Init Resource Files Q_INIT_RESOURCE(qmls); // MainView, that will hold the QML UI MainView mainView; #if defined(Q_OS_SYMBIAN) qt_SetDefaultIap(); // This will avoid the browser to keep asking for an IAP #elif defined(Q_WS_MAEMO_5) mainView.setAttribute(Qt::WA_Maemo5NonComposited, true); //< This will avoid the use of Composite on this Parentless-Widget mainView.setAttribute(Qt::WA_Maemo5AutoOrientation, true); //< "Qt::WA_Maemo5PortraitOrientation" or "Qt::WA_Maemo5LandscapeOrientation" or "Qt::WA_Maemo5AutoOrientation" #endif #if defined(Q_OS_MAC) || defined(Q_OS_WIN32) //desktop build, just open a window // mainView.setWindowFlags(Qt::FramelessWindowHint); mainView.show(); #else //TODO recognise whether Q_OS_LINUX is defined and understand whether is meego or desktop linux //mobile builds, we want the whole screen! mainView.showFullScreen(); #endif // The Core of the Application Core core(&mainView); core.start(); return app.exec(); }
int main(int argc, char *argv[]) { qputenv("QMLSCENE_DEVICE", "epaper"); qputenv("QT_QPA_PLATFORM", "epaper:enable_fonts"); qputenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS", "rotate=180"); system("/usr/bin/button-capture &"); QGuiApplication app(argc, argv); MainView view; srand(time(NULL)); view.rootContext()->setContextProperty("screenGeometry", app.primaryScreen()->geometry()); view.engine()->addImportPath(QStringLiteral(DEPLOYMENT_PATH)); view.setSource(QDir(DEPLOYMENT_PATH).filePath("qml/Main.qml")); view.show(); Options options(&view, &app); return app.exec(); }