fix build failures with newer compiler versions

This commit is contained in:
wmayer
2019-02-12 13:10:49 +01:00
parent b29209d523
commit fb37201299
5 changed files with 32 additions and 0 deletions

View File

@@ -167,6 +167,9 @@ public:
#endif
setFormat(surfaceFormat);
}
~CustomGLWidget()
{
}
void initializeGL()
{
QOpenGLContext *context = QOpenGLContext::currentContext();
@@ -187,6 +190,13 @@ public:
}
void aboutToDestroyGLContext()
{
#if QT_VERSION >= 0x050900
// With Qt 5.9 a signal is emitted while the QuarterWidget is being destroyed.
// At this state its type is a QWidget, not a QuarterWidget any more.
QuarterWidget* qw = qobject_cast<QuarterWidget*>(parent());
if (!qw)
return;
#endif
QMetaObject::invokeMethod(parent(), "aboutToDestroyGLContext",
Qt::DirectConnection,
QGenericReturnArgument());

View File

@@ -33,6 +33,12 @@
# include <QImageWriter>
#endif
#if !defined(FC_OS_MACOSX)
# include <GL/gl.h>
# include <GL/glu.h>
# include <GL/glext.h>
#endif
//gcc
# include <iomanip>
# include <ios>

View File

@@ -85,6 +85,12 @@
# include <QMimeData>
#endif
#if defined(FC_OS_MACOSX)
# include <GL/gl.h>
# include <GL/glu.h>
# include <GL/glext.h>
#endif
#include <QVariantAnimation>
#include <sstream>

View File

@@ -14,6 +14,12 @@ include_directories(
${XercesC_INCLUDE_DIRS}
)
if(MSVC)
include_directories(
${CMAKE_SOURCE_DIR}/src/3rdParty/OpenGL/api
)
endif(MSVC)
set(ImageGui_LIBS
Image
FreeCADGui

View File

@@ -39,9 +39,13 @@
# include <Windows.h>
# include <GL/gl.h>
# include <GL/glu.h>
# if defined(_MSC_VER) && _MSC_VER >= 1910
# include <GL/glext.h>
# endif
#else
# include <GL/gl.h>
# include <GL/glu.h>
# include <GL/glext.h>
#endif
#include "OpenGLImageBox.h"