#include #include #include int main(int argc, char *argv[]) { #if 0 // For B2Qt and QNX qputenv("QT_QPA_EGLFS_HIDECURSOR", "1"); qputenv("QT_QPA_EGLFS_DISABLE_INPUT", "1"); qputenv("QT_QPA_EGLFS_WIDTH", "1280"); qputenv("QT_QPA_EGLFS_HEIGHT", "480"); qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", "293"); qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", "110"); qputenv("QSG_RENDER_LOOP", "threaded"); // Debugging // qputenv("QT_QPA_EGLFS_DEBUG", "1"); // qputenv("QSG_INFO", "1"); // qputenv("QT_LOGGING_RULES", "qt.qpa.*=true"); // Disable all extra logging qputenv("QT_LOGGING_RULES", "*=false"); // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QGuiApplication app(argc, argv); #if defined(Q_OS_MACOS) QSurfaceFormat openGLFormat; openGLFormat.setRenderableType(QSurfaceFormat::OpenGL); openGLFormat.setProfile(QSurfaceFormat::CoreProfile); openGLFormat.setMajorVersion(4); openGLFormat.setMinorVersion(1); openGLFormat.setStencilBufferSize(8); QSurfaceFormat::setDefaultFormat(openGLFormat); #endif QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); }