diff --git a/AABB_tree/demo/AABB_tree/Viewer.cpp b/AABB_tree/demo/AABB_tree/Viewer.cpp index 2f411def1df..35b2496a69f 100644 --- a/AABB_tree/demo/AABB_tree/Viewer.cpp +++ b/AABB_tree/demo/AABB_tree/Viewer.cpp @@ -5,7 +5,7 @@ #include Viewer::Viewer(QWidget* parent) - : QGLViewer(CGAL::Qt::createOpenGLContext(),parent), + : QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent), m_pScene(NULL), m_custom_mouse(false) { diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp index a5a0dd2f222..e1f2e029a66 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp @@ -5,7 +5,7 @@ #include "CGAL/Qt/CreateOpenGLContext.h" Viewer::Viewer(QWidget* parent) - : QGLViewer(CGAL::Qt::createOpenGLContext(),parent) + : QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent) { are_buffers_initialized = false; } diff --git a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp index 0036038b6de..413cbeca0e8 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp +++ b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp @@ -7,7 +7,7 @@ Viewer::Viewer(QWidget* parent ) - : QGLViewer(CGAL::Qt::createOpenGLContext(),parent) + : QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent) { extension_is_found = false; } diff --git a/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h b/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h index 48799048e41..d05c5904cc6 100644 --- a/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h +++ b/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h @@ -23,9 +23,9 @@ #include namespace CGAL{ namespace Qt{ -inline QGLContext* createOpenGLContext() +inline QGLContext* createOpenGLContext(QObject* parent) { - QOpenGLContext *context = new QOpenGLContext(); + QOpenGLContext *context = new QOpenGLContext(parent); QSurfaceFormat format; format.setVersion(2,1); format.setProfile(QSurfaceFormat::CompatibilityProfile); @@ -35,9 +35,9 @@ inline QGLContext* createOpenGLContext() return result; } -inline QGLContext* createOpenGLMSAAContext() +inline QGLContext* createOpenGLMSAAContext(QObject* parent) { - QOpenGLContext *context = new QOpenGLContext(); + QOpenGLContext *context = new QOpenGLContext(parent); QSurfaceFormat format; format.setVersion(2,1); format.setProfile(QSurfaceFormat::CompatibilityProfile); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index dca13ab0f40..052dda15a5b 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -28,7 +28,7 @@ #include Viewer::Viewer(QWidget* parent) - : QGLViewer(CGAL::Qt::createOpenGLMSAAContext(),parent), wireframe(false), + : QGLViewer(CGAL::Qt::createOpenGLMSAAContext(parent),parent), wireframe(false), flatShading(true), edges(true), vertices(true), m_previous_scene_empty(true), are_buffers_initialized(false) { diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 390519eb032..9556c4f4bb6 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -11,11 +11,11 @@ endif() # If you want to visualize a linear cell complex, you can use the following viewer # based on qt. Just uncomment the following two lines, plus the lines qt5_use_modules below -# find_package(CGAL COMPONENTS Qt5) -# include("CMakeLCCViewerQt.inc") + find_package(CGAL COMPONENTS Qt5) + include("CMakeLCCViewerQt.inc") # If you don't want to visualize, use the following line (otherwise comment it) -find_package(CGAL QUIET COMPONENTS Core) +#find_package(CGAL QUIET COMPONENTS Core) # For Gprof. # ADD_DEFINITIONS("-pg") @@ -43,12 +43,12 @@ if ( CGAL_FOUND ) add_executable(voronoi_2 voronoi_2.cpp) target_link_libraries(voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${MAP_VIEWER_LIBRARIES}) - # qt5_use_modules(voronoi_2 ${MAP_VIEWER_MODULES}) + qt5_use_modules(voronoi_2 ${MAP_VIEWER_MODULES}) add_executable(voronoi_3 voronoi_3.cpp) target_link_libraries(voronoi_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${MAP_VIEWER_LIBRARIES}) - # qt5_use_modules(voronoi_3 ${MAP_VIEWER_MODULES}) + qt5_use_modules(voronoi_3 ${MAP_VIEWER_MODULES}) else() diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_qt.h b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_qt.h index ed390cf7cd8..10418b03a50 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_qt.h +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_qt.h @@ -154,7 +154,7 @@ class SimpleLCCViewerQt : public QGLViewer, public QOpenGLFunctions_2_1 public: // Constructor/Destructor SimpleLCCViewerQt(LCC& alcc) : - QGLViewer(CGAL::Qt::createOpenGLContext()), + QGLViewer(CGAL::Qt::createOpenGLContext(0)), lcc(alcc), wireframe(false), flatShading(true), diff --git a/Mesh_3/demo/Mesh_3/src/CGAL_demo/Viewer.cpp b/Mesh_3/demo/Mesh_3/src/CGAL_demo/Viewer.cpp index 908ed02fc38..5df0afa2a13 100644 --- a/Mesh_3/demo/Mesh_3/src/CGAL_demo/Viewer.cpp +++ b/Mesh_3/demo/Mesh_3/src/CGAL_demo/Viewer.cpp @@ -3,7 +3,7 @@ #include Viewer::Viewer(QWidget* parent, bool antialiasing) - : QGLViewer(CGAL::Qt::createOpenGLContext(), parent), + : QGLViewer(CGAL::Qt::createOpenGLContext(parent), parent), scene(0), antialiasing(antialiasing), twosides(false), diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Viewer.cpp b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Viewer.cpp index 51521874203..ebb98bb5238 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Viewer.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Viewer.cpp @@ -2,7 +2,7 @@ #include Viewer::Viewer(QWidget *parent) -: QGLViewer(CGAL::Qt::createOpenGLContext(),parent) +: QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent) {} Viewer::~Viewer() {} diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Viewer.h b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Viewer.h index c03df5c5c65..bf2fc24c863 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Viewer.h +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Viewer.h @@ -22,7 +22,7 @@ class Viewer : public QGLViewer, QOpenGLFunctions_2_1 { int nr_of_facets; public: Viewer(QWidget* parent) - : QGLViewer(CGAL::Qt::createOpenGLContext(), parent) + : QGLViewer(CGAL::Qt::createOpenGLContext(parent), parent) {} ~Viewer() { diff --git a/Three/include/CGAL/Three/Viewer_interface.h b/Three/include/CGAL/Three/Viewer_interface.h index e99b5bbd785..d6e0a2ca4b7 100644 --- a/Three/include/CGAL/Three/Viewer_interface.h +++ b/Three/include/CGAL/Three/Viewer_interface.h @@ -64,7 +64,7 @@ public: NB_OF_PROGRAMS /** Holds the number of different programs in this enum.*/ }; - Viewer_interface(QWidget* parent) : QGLViewer(CGAL::Qt::createOpenGLContext(), parent) {} + Viewer_interface(QWidget* parent) : QGLViewer(CGAL::Qt::createOpenGLContext(parent), parent) {} virtual ~Viewer_interface() {} //! Sets the scene for the viewer. diff --git a/Triangulation_3/demo/Triangulation_3/Viewer.h b/Triangulation_3/demo/Triangulation_3/Viewer.h index c865f018a41..ca4362ec0c7 100644 --- a/Triangulation_3/demo/Triangulation_3/Viewer.h +++ b/Triangulation_3/demo/Triangulation_3/Viewer.h @@ -24,7 +24,7 @@ class Viewer : public QGLViewer, QOpenGLFunctions_2_1 { public: Viewer(QWidget* parent) - : QGLViewer(CGAL::Qt::createOpenGLContext(),parent) + : QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent) , m_showAxis(false) , m_showVertex(true) , m_showDEdge(true)