Gui: remove support of using deprecated Qt OpenGL API

This commit is contained in:
wmayer
2022-01-26 14:46:41 +01:00
parent 233182dcd6
commit a87e33258d
20 changed files with 22 additions and 1261 deletions

View File

@@ -47,9 +47,7 @@
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/filesystem.hpp>
#include <QtOpenGL.h>
#if defined(HAVE_QT5_OPENGL)
#include <QWindow>
#endif
// FreeCAD Base header
#include <Base/Console.h>
@@ -2017,40 +2015,6 @@ void Application::runApplication(void)
// register action style event type
ActionStyleEvent::EventType = QEvent::registerEventType(QEvent::User + 1);
// check for OpenGL
#if !defined(HAVE_QT5_OPENGL)
if (!QGLFormat::hasOpenGL()) {
QMessageBox::critical(0, QObject::tr("No OpenGL"), QObject::tr("This system does not support OpenGL"));
throw Base::RuntimeError("This system does not support OpenGL");
}
if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
Base::Console().Log("This system does not support framebuffer objects\n");
}
if (!QGLPixelBuffer::hasOpenGLPbuffers()) {
Base::Console().Log("This system does not support pbuffers\n");
}
QGLFormat::OpenGLVersionFlags version = QGLFormat::openGLVersionFlags ();
if (version & QGLFormat::OpenGL_Version_3_0)
Base::Console().Log("OpenGL version 3.0 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_2_1)
Base::Console().Log("OpenGL version 2.1 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_2_0)
Base::Console().Log("OpenGL version 2.0 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_1_5)
Base::Console().Log("OpenGL version 1.5 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_1_4)
Base::Console().Log("OpenGL version 1.4 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_1_3)
Base::Console().Log("OpenGL version 1.3 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_1_2)
Base::Console().Log("OpenGL version 1.2 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_1_1)
Base::Console().Log("OpenGL version 1.1 or higher is present\n");
else if (version & QGLFormat::OpenGL_Version_None)
Base::Console().Log("No OpenGL is present or no OpenGL context is current\n");
#endif
ParameterGrp::handle hTheme = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Bitmaps/Theme");
#if !defined(Q_OS_LINUX)
QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << QString::fromLatin1(":/icons/FreeCAD-default"));
@@ -2135,7 +2099,6 @@ void Application::runApplication(void)
mainApp.installEventFilter(filter);
}
#if defined(HAVE_QT5_OPENGL)
{
QWindow window;
window.setSurfaceType(QWindow::OpenGLSurface);
@@ -2157,7 +2120,6 @@ void Application::runApplication(void)
Base::Console().Log("OpenGL version is: %d.%d (%s)\n", major, minor, glVersion);
}
}
#endif
// init the Inventor subsystem
initOpenInventor();