From c8dfc2fd345d66b655de2d07dfd7be3605b4c4d8 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 18 Feb 2022 13:06:55 +0100 Subject: [PATCH 1/2] Bump version to 0.5.1 --- version.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.pri b/version.pri index 3b5f87ab..75efb074 100644 --- a/version.pri +++ b/version.pri @@ -10,7 +10,7 @@ defined(HAVE_GIT, var) { MAYO_VERSION_MAJ = 0 MAYO_VERSION_MIN = 5 -MAYO_VERSION_PAT = 0 +MAYO_VERSION_PAT = 1 VERSION = $${MAYO_VERSION_MAJ}.$${MAYO_VERSION_MIN}.$${MAYO_VERSION_PAT}.$${MAYO_VERSION_REVNUM} MAYO_VERSION = $${VERSION}-$$MAYO_VERSION_COMMIT From 42103a1b03f66489e6eb3fc361c2fb2df0065be0 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 18 Feb 2022 13:07:43 +0100 Subject: [PATCH 2/2] App: fix crash at application startup in CLI-mode Relates to GitHub issue #106 --- src/app/main.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 51eb4b01..d42dee47 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -366,23 +366,23 @@ static void initGui(GuiApplication* guiApp) if (!guiApp) return; - // Retrieve OpenGL infos - const std::string strGlVersion = queryGlVersionString(); - const QVersionNumber glVersion = parseSemanticVersionString(strGlVersion); - qInfo() << fmt::format("OpenGL v{}.{}", glVersion.majorVersion(), glVersion.minorVersion()).c_str(); - // Fallback for OpenGL setFunctionCreateGraphicsDriver(&QWidgetOccView::createCompatibleGraphicsDriver); IWidgetOccView::setCreator(&QWidgetOccView::create); // Use QOpenGLWidget if possible #if OCC_VERSION_HEX >= 0x070600 - if (!glVersion.isNull() && glVersion.majorVersion() >= 2) { // Requires at least OpenGL version >= 2.0 - setFunctionCreateGraphicsDriver(&QOpenGLWidgetOccView::createCompatibleGraphicsDriver); - IWidgetOccView::setCreator(&QOpenGLWidgetOccView::create); - } - else { - qWarning() << "Can't use QOpenGLWidget because OpenGL version is too old"; + if (qobject_cast(QCoreApplication::instance())) { // QOpenGL requires QGuiApplication + const std::string strGlVersion = queryGlVersionString(); + const QVersionNumber glVersion = parseSemanticVersionString(strGlVersion); + qInfo() << fmt::format("OpenGL v{}.{}", glVersion.majorVersion(), glVersion.minorVersion()).c_str(); + if (!glVersion.isNull() && glVersion.majorVersion() >= 2) { // Requires at least OpenGL version >= 2.0 + setFunctionCreateGraphicsDriver(&QOpenGLWidgetOccView::createCompatibleGraphicsDriver); + IWidgetOccView::setCreator(&QOpenGLWidgetOccView::create); + } + else { + qWarning() << "Can't use QOpenGLWidget because OpenGL version is too old"; + } } #endif