From 243c7b1c7541995ef91d76d70ad2e89674aba9cb Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 8 Jul 2019 14:05:42 +0200 Subject: [PATCH 1/7] Replace matrix with worldTransform --- .../demo/Circular_kernel_2/ArcsGraphicsItem.h | 6 ++--- .../Qt/PeriodicTriangulationGraphicsItem.h | 24 +++++++++---------- .../include/CGAL/Qt/AlphaShapeGraphicsItem.h | 16 ++++++------- .../DelaunayMeshTriangulationGraphicsItem.h | 6 ++--- .../include/CGAL/Qt/PointsGraphicsItem.h | 4 ++-- .../CGAL/Qt/PointsInKdTreeGraphicsItem.h | 4 ++-- .../include/CGAL/Qt/PolygonGraphicsItem.h | 4 ++-- .../CGAL/Qt/PolygonWithHolesGraphicsItem.h | 4 ++-- .../include/CGAL/Qt/RegularGridGraphicsItem.h | 4 ++-- .../Qt/RegularGridVectorFieldGraphicsItem.h | 4 ++-- .../Qt/RegularTriangulationGraphicsItem.h | 10 ++++---- .../Qt/SegmentDelaunayGraphGraphicsItem.h | 4 ++-- .../Qt/SegmentDelaunayGraphLinfGraphicsItem.h | 4 ++-- .../CGAL/Qt/TriangulationGraphicsItem.h | 16 ++++++------- .../Polyline_simplification_2_graphics_item.h | 10 ++++---- .../Qt/TriangulationArrangementGraphicsItem.h | 10 ++++---- 16 files changed, 65 insertions(+), 65 deletions(-) diff --git a/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h b/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h index 028ba1e442f..03a594a2b45 100644 --- a/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h +++ b/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h @@ -116,10 +116,10 @@ ArcsGraphicsItem::paint(QPainter *painter, Line_arc_2 la; if(assign(cap_ui, *it)){ - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); painter->drawPoint(matrix.map(convert(cap_ui.first))); - painter->setMatrix(matrix); + painter->setWorldTransform(matrix); }if(assign(ca, *it)){ painterostream << ca; } else if(assign(la, *it)){ diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h b/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h index 5c2648a5284..b8e1268e943 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h +++ b/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h @@ -223,8 +223,8 @@ namespace CGAL { Converter convert; - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); { // Faces painter->setPen(QPen()); @@ -254,7 +254,7 @@ namespace CGAL { } } - painter->setMatrix(matrix); + painter->setWorldTransform(matrix); } if(visibleEdges()) { @@ -272,8 +272,8 @@ namespace CGAL { if(visibleVertices()) { Converter convert; - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); QPen pen = verticesPen(); if (t->number_of_vertices() < 8) { @@ -301,7 +301,7 @@ namespace CGAL { } } - painter->setMatrix(matrix); + painter->setWorldTransform(matrix); } } @@ -312,10 +312,10 @@ namespace CGAL { Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(point))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template @@ -325,10 +325,10 @@ namespace CGAL { Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(vh->point()))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template diff --git a/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h b/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h index 8a0fa3d212e..884991deb13 100644 --- a/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h @@ -242,8 +242,8 @@ AlphaShapeGraphicsItem::paintVertices(QPainter *painter) Converter convert; painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename T::Finite_vertices_iterator it = t->finite_vertices_begin(); it != t->finite_vertices_end(); it++){ @@ -260,10 +260,10 @@ AlphaShapeGraphicsItem::paintOneVertex(const typename T::Point& point) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(point))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template @@ -273,10 +273,10 @@ AlphaShapeGraphicsItem::paintVertex(typename T::Vertex_handle vh) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(vh->point()))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template diff --git a/GraphicsView/include/CGAL/Qt/DelaunayMeshTriangulationGraphicsItem.h b/GraphicsView/include/CGAL/Qt/DelaunayMeshTriangulationGraphicsItem.h index ce738f10251..525f18db1a0 100644 --- a/GraphicsView/include/CGAL/Qt/DelaunayMeshTriangulationGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/DelaunayMeshTriangulationGraphicsItem.h @@ -265,14 +265,14 @@ DelaunayMeshTriangulationGraphicsItem::paintSeeds(QPainter *painter) { Converter convert; painter->setPen(this->seedsPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); typename std::list::iterator sit; for(sit = seeds_begin; sit != seeds_end; ++sit) painter->drawPoint(matrix.map(convert(*sit))); - painter->setMatrix(matrix); + painter->setWorldTransform(matrix); } } diff --git a/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h index 1b9e16afbf3..fb6d2d75ad1 100644 --- a/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h @@ -124,8 +124,8 @@ PointsGraphicsItem

::paint(QPainter *painter, Converter convert; painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename P::iterator it = points->begin(); it != points->end(); it++){ diff --git a/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h index 174df6b81ca..b3afe81e613 100644 --- a/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h @@ -160,8 +160,8 @@ PointsInKdTreeGraphicsItem::paint(QPainter *painter, Iso_rectangle_2 isor = convert(option->exposedRect); Fuzzy_iso_box range(isor.vertex(0), isor.vertex(2)); painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); Draw draw(painter, &matrix); kdtree->search(draw, range); } diff --git a/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h index e3cb1fea05e..e196243da05 100644 --- a/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h @@ -154,8 +154,8 @@ PolygonGraphicsItem

::paint(QPainter *painter, Converter convert; painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename P::Vertex_iterator it = poly->vertices_begin(); it != poly->vertices_end(); it++){ diff --git a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h index 7cfc8883694..cfdcb4fa915 100644 --- a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h @@ -181,8 +181,8 @@ PolygonWithHolesGraphicsItem

::paint(QPainter *painter, if(drawVertices()) { painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename P::General_polygon_2::Vertex_iterator it = poly->outer_boundary().vertices_begin(); it != poly->outer_boundary().vertices_end(); it++){ diff --git a/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h b/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h index f5f519afa31..ddcbb303032 100644 --- a/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h @@ -180,8 +180,8 @@ void /* painter->setPen(this->verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(int i = 0; i < nw; i++){ for(int j = 0; j < nh; j++){ painter->drawPoint(matrix.map(QPointF(i*dw, j*dh))); diff --git a/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h b/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h index bcddcc2ccf7..fd9367cd04a 100644 --- a/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h @@ -163,8 +163,8 @@ void } } painter->setPen(this->verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(int i = 0; i < nw; i++){ for(int j = 0; j < nh; j++){ painter->drawPoint(matrix.map(QPointF(i*dw, j*dh))); diff --git a/GraphicsView/include/CGAL/Qt/RegularTriangulationGraphicsItem.h b/GraphicsView/include/CGAL/Qt/RegularTriangulationGraphicsItem.h index bcd70597fb3..f838e505775 100644 --- a/GraphicsView/include/CGAL/Qt/RegularTriangulationGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/RegularTriangulationGraphicsItem.h @@ -209,8 +209,8 @@ RegularTriangulationGraphicsItem::paintVertices(QPainter *painter) } - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename T::Finite_vertices_iterator it = t->finite_vertices_begin(); it != t->finite_vertices_end(); it++){ @@ -228,10 +228,10 @@ RegularTriangulationGraphicsItem::paintOneVertex(const typename T::Point& poi typename T::Bare_point p = t->geom_traits().construct_point_2_object()(point); m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(p))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template diff --git a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h index d9fb9e6b5e0..33799f93e6d 100644 --- a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h @@ -165,8 +165,8 @@ SegmentDelaunayGraphGraphicsItem::drawAll(QPainter *painter, const QStyleOpti } { m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); Converter convert; typename T::Finite_vertices_iterator vit; for (vit = t->finite_vertices_begin(); diff --git a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h index 43ba00ccbf6..170e1cae0bd 100644 --- a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h @@ -200,8 +200,8 @@ SegmentDelaunayGraphLinfGraphicsItem::drawAll(QPainter *painter, const QStyle } { m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); Converter convert; typename T::Finite_vertices_iterator vit; for (vit = t->finite_vertices_begin(); diff --git a/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h b/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h index 6fa0ed0c240..30d74c01471 100644 --- a/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h @@ -197,8 +197,8 @@ TriangulationGraphicsItem::paintVertices(QPainter *painter) Converter convert; painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename T::Finite_vertices_iterator it = t->finite_vertices_begin(); it != t->finite_vertices_end(); it++){ @@ -215,10 +215,10 @@ TriangulationGraphicsItem::paintOneVertex(const typename T::Point& point) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(point))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template @@ -228,10 +228,10 @@ TriangulationGraphicsItem::paintVertex(typename T::Vertex_handle vh) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(vh->point()))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/Polyline_simplification_2_graphics_item.h b/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/Polyline_simplification_2_graphics_item.h index 326b27b22f9..f40dcd9cfae 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/Polyline_simplification_2_graphics_item.h +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/Polyline_simplification_2_graphics_item.h @@ -175,10 +175,10 @@ PolylineSimplificationGraphicsItem::paintVertex( typename PCT::Vertex_handl // } else { this->m_painter->setPen(this->verticesPen()); // } - QMatrix matrix = this->m_painter->matrix(); - this->m_painter->resetMatrix(); + QTransform matrix = this->m_painter->worldTransform(); + this->m_painter->resetTransform(); this->m_painter->drawPoint(matrix.map(convert(vh->point()))); - this->m_painter->setMatrix(matrix); + this->m_painter->setWorldTransform(matrix); } @@ -190,8 +190,8 @@ PolylineSimplificationGraphicsItem::paintVertices(QPainter *painter) { Converter convert; - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(Constraint_iterator cit = this->t->constraints_begin(); cit != this->t->constraints_end(); ++cit){ diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/TriangulationArrangementGraphicsItem.h b/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/TriangulationArrangementGraphicsItem.h index 6f7359eef00..0de22e1ee60 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/TriangulationArrangementGraphicsItem.h +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/include/CGAL/Qt/TriangulationArrangementGraphicsItem.h @@ -154,10 +154,10 @@ TriangulationArrangementGraphicsItem::paintVertex(typename T::Vertex_handle v } else { this->m_painter->setPen(this->verticesPen()); } - QMatrix matrix = this->m_painter->matrix(); - this->m_painter->resetMatrix(); + QTransform matrix = this->m_painter->worldTransform(); + this->m_painter->resetTransform(); this->m_painter->drawPoint(matrix.map(convert(vh->point()))); - this->m_painter->setMatrix(matrix); + this->m_painter->setWorldTransform(matrix); } } @@ -170,8 +170,8 @@ TriangulationArrangementGraphicsItem::paintVertices(QPainter *painter) { Converter convert; - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename T::Finite_vertices_iterator it = this->t->finite_vertices_begin(); it != this->t->finite_vertices_end(); it++) From 6e1e8e9dc496694adb7741f8fec65f6f67ba0735 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 9 Jul 2019 10:22:30 +0200 Subject: [PATCH 2/7] add missing modifications --- GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h index b3afe81e613..388faed8d76 100644 --- a/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h @@ -57,10 +57,10 @@ class PointsInKdTreeGraphicsItem : public GraphicsItem class Draw : public CGAL::cpp98::iterator { QPainter* painter; - QMatrix* matrix; + QTransform* matrix; Converter convert; public: - Draw(QPainter* painter, QMatrix* matrix) + Draw(QPainter* painter, QTransform* matrix) : painter(painter), matrix(matrix) {} From d21709d0bd4c54cb5331218b8daf858e9e430c9d Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 10 Jul 2019 11:58:13 +0200 Subject: [PATCH 3/7] More ->matrix() replaced --- .../internal/Qt/TriangulationGraphicsItem.h | 10 +++++----- .../Qt/TriangulationGraphicsItemWithColorInfo.h | 16 ++++++++-------- .../internal/Qt/TriangulationGraphicsItem.h | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h index 22d185807c5..5dc2f7364a7 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h @@ -174,8 +174,8 @@ TriangulationGraphicsItem::paintVertices(QPainter *painter) Converter convert; painter->setPen(vertices_pen); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename T::All_vertices_iterator it = t->all_vertices_begin(); it != t->all_vertices_end(); it++){ @@ -191,10 +191,10 @@ TriangulationGraphicsItem::paintVertex(typename T::Vertex_handle vh) { Converter convert; m_painter->setPen(vertices_pen); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(t->point(vh)))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItemWithColorInfo.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItemWithColorInfo.h index d5d12cf31d4..0ab303ce31f 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItemWithColorInfo.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItemWithColorInfo.h @@ -196,8 +196,8 @@ TriangulationGraphicsItem::paintVertices(QPainter *painter) Converter convert; painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); - painter->resetMatrix(); + QTransform matrix = painter->worldTransform(); + painter->resetTransform(); for(typename T::Finite_vertices_iterator it = t->finite_vertices_begin(); it != t->finite_vertices_end(); it++){ @@ -311,10 +311,10 @@ TriangulationGraphicsItem::paintOneVertex(const typename T::Point& point) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(point))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template @@ -324,10 +324,10 @@ TriangulationGraphicsItem::paintVertex(typename T::Vertex_handle vh) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(t->point(vh)))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h index 7a7a742d678..e323f616cee 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h @@ -365,10 +365,10 @@ TriangulationGraphicsItem::paintVertices(QPainter *painter) Converter convert; painter->setPen(verticesPen()); - QMatrix matrix = painter->matrix(); + QTransform matrix = painter->worldTransform(); //QMatrix tr(1, 0, 0, -1, 0, 0); //matrix = tr*matrix; - painter->resetMatrix(); + painter->resetTransform(); QPen temp = painter->pen(); QPen old = temp; @@ -455,10 +455,10 @@ TriangulationGraphicsItem::paintOneVertex(const typename T::Point& point) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(point))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template @@ -468,10 +468,10 @@ TriangulationGraphicsItem::paintVertex(typename T::Vertex_handle vh) Converter convert; m_painter->setPen(this->verticesPen()); - QMatrix matrix = m_painter->matrix(); - m_painter->resetMatrix(); + QTransform matrix = m_painter->worldTransform(); + m_painter->resetTransform(); m_painter->drawPoint(matrix.map(convert(vh->point()))); - m_painter->setMatrix(matrix); + m_painter->setWorldTransform(matrix); } template From 118453053072bef10c0b5874fd4957a4d5c321cd Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 10 Jul 2019 14:02:06 +0200 Subject: [PATCH 4/7] More warnings fixed --- AABB_tree/demo/AABB_tree/MainWindow.cpp | 2 +- .../include/CGAL/Qt/DemosMainWindow_impl.h | 3 +-- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 16 ++++++++-------- Polyhedron/demo/Polyhedron/MainWindow.cpp | 15 +++++++++++---- .../Plugins/Mesh_3/Io_image_plugin.cpp | 12 ++++++++++++ Polyhedron/demo/Polyhedron/Scene.cpp | 2 +- Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp | 4 ++-- Polyhedron/demo/Polyhedron/Viewer.cpp | 8 +++++++- .../Principal_component_analysis/MainWindow.cpp | 2 +- Three/include/CGAL/Three/TextRenderer.h | 8 +++++++- Triangulation_3/demo/Triangulation_3/Viewer.cpp | 4 ++-- 11 files changed, 53 insertions(+), 23 deletions(-) diff --git a/AABB_tree/demo/AABB_tree/MainWindow.cpp b/AABB_tree/demo/AABB_tree/MainWindow.cpp index 8cd596d6bbc..636febda8ce 100644 --- a/AABB_tree/demo/AABB_tree/MainWindow.cpp +++ b/AABB_tree/demo/AABB_tree/MainWindow.cpp @@ -23,7 +23,7 @@ MainWindow::MainWindow(QWidget* parent) m_pViewer = ui->viewer; // does not save the state of the viewer - m_pViewer->setStateFileName(QString::null); + m_pViewer->setStateFileName(QString()); // accepts drop events setAcceptDrops(true); diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h index b4d696f763b..2bd20a14c9d 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h @@ -461,9 +461,8 @@ void DemosMainWindow::readState(QString groupname, Options /*what_to_save*/) settings.beginGroup(groupname); resize(settings.value("size", this->size()).toSize()); - QDesktopWidget* desktop = qApp->desktop(); QPoint pos = settings.value("pos", this->pos()).toPoint(); - if(desktop->availableGeometry(pos).contains(pos)) { + if(QGuiApplication::screenAt(pos)) { move(pos); } QByteArray mainWindowState = settings.value("state").toByteArray(); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 972896a063a..90e8b9e74c8 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -1606,7 +1606,7 @@ CGAL_INLINE_FUNCTION QString CGAL::QGLViewer::mouseActionString(qglviewer::MouseAction ma) { switch (ma) { case CGAL::qglviewer::NO_MOUSE_ACTION: - return QString::null; + return QString(); case CGAL::qglviewer::ROTATE: return CGAL::QGLViewer::tr("Rotates", "ROTATE mouse action"); case CGAL::qglviewer::ZOOM: @@ -1632,14 +1632,14 @@ QString CGAL::QGLViewer::mouseActionString(qglviewer::MouseAction ma) { case CGAL::qglviewer::ZOOM_ON_REGION: return CGAL::QGLViewer::tr("Zooms on region for", "ZOOM_ON_REGION mouse action"); } - return QString::null; + return QString(); } CGAL_INLINE_FUNCTION QString CGAL::QGLViewer::clickActionString(CGAL::qglviewer::ClickAction ca) { switch (ca) { case CGAL::qglviewer::NO_CLICK_ACTION: - return QString::null; + return QString(); case CGAL::qglviewer::ZOOM_ON_PIXEL: return CGAL::QGLViewer::tr("Zooms on pixel", "ZOOM_ON_PIXEL click action"); case CGAL::qglviewer::ZOOM_TO_FIT: @@ -1664,7 +1664,7 @@ QString CGAL::QGLViewer::clickActionString(CGAL::qglviewer::ClickAction ca) { case CGAL::qglviewer::ALIGN_CAMERA: return CGAL::QGLViewer::tr("Aligns camera", "ALIGN_CAMERA click action"); } - return QString::null; + return QString(); } static QString keyString(unsigned int key) { @@ -1946,7 +1946,7 @@ void CGAL::QGLViewer::setKeyDescription(unsigned int key, QString description) { CGAL_INLINE_FUNCTION QString CGAL::QGLViewer::cameraPathKeysString() const { if (pathIndex_.isEmpty()) - return QString::null; + return QString(); QVector< ::Qt::Key> keys; keys.reserve(pathIndex_.count()); @@ -1954,7 +1954,7 @@ QString CGAL::QGLViewer::cameraPathKeysString() const { endi = pathIndex_.end(); i != endi; ++i) keys.push_back(i.key()); - qSort(keys); + std::sort(keys.begin(), keys.end()); QVector< ::Qt::Key>::const_iterator it = keys.begin(), end = keys.end(); QString res = keyString(*it); @@ -3544,7 +3544,7 @@ This is the name of the XML file where saveStateToFile() saves the viewer state restoreStateFromFile() to restore this state later (usually in your init() method). -Setting this value to \c QString::null will disable the automatic state file +Setting this value to \c QString() will disable the automatic state file saving that normally occurs on exit. If more than one viewer are created by the application, this function will @@ -3576,7 +3576,7 @@ Use restoreStateFromFile() to restore this viewer state. This method is automatically called when a viewer is closed (using Escape or using the window's upper right \c x close button). setStateFileName() to \c -QString::null to prevent this. */ +QString() to prevent this. */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::saveStateToFile() { QString name = stateFileName(); diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 805f71468e3..326da8f6ead 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -145,7 +145,7 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) sceneView = ui->sceneView; viewer = ui->viewer; // do not save the state of the viewer (anoying) - viewer->setStateFileName(QString::null); + viewer->setStateFileName(QString()); // setup scene scene = new Scene(this); @@ -677,7 +677,7 @@ void MainWindow::updateMenus() } // sort the operations menu by name as = ui->menuOperations->actions(); - qSort(as.begin(), as.end(), actionsByName); + std::sort(as.begin(), as.end(), actionsByName); ui->menuOperations->clear(); ui->menuOperations->addActions(as); } @@ -1990,9 +1990,9 @@ void MainWindow::on_actionLoadPlugin_triggered() void MainWindow::recurseExpand(QModelIndex index) { int row = index.row(); - if(index.child(0,0).isValid()) + if(scene->index(0,0,index).isValid()) { - recurseExpand(index.child(0,0)); + recurseExpand(scene->index(0,0,index)); } CGAL::Three::Scene_group_item* group = qobject_cast(scene->item(scene->getIdFromModelIndex(index))); @@ -2171,10 +2171,17 @@ void MainWindow::resetHeader() sceneView->header()->setSectionResizeMode(Scene::RenderingModeColumn, QHeaderView::ResizeToContents); sceneView->header()->setSectionResizeMode(Scene::ABColumn, QHeaderView::Fixed); sceneView->header()->setSectionResizeMode(Scene::VisibleColumn, QHeaderView::Fixed); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); + sceneView->resizeColumnToContents(Scene::RenderingModeColumn); + sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); + sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); +#else sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().width("_#_")); sceneView->resizeColumnToContents(Scene::RenderingModeColumn); sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().width(QString("_AB_"))); sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().width(QString("_View_"))); +#endif } void MainWindow::reset_default_loaders() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 300b1614b73..b02ce415ae7 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -577,7 +577,11 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = x_cubeLabel->fontMetrics(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + x_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); +#else x_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); +#endif x_cubeLabel->setText("0"); x_cubeLabel->setValidator(validator); @@ -603,7 +607,11 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = y_cubeLabel->fontMetrics(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + y_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); +#else y_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); +#endif y_cubeLabel->setText("0"); y_cubeLabel->setValidator(validator); y_slider = new QSlider(mw); @@ -628,7 +636,11 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = z_cubeLabel->fontMetrics(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + z_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); +#else z_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); +#endif z_cubeLabel->setText("0"); z_cubeLabel->setValidator(validator); z_slider = new QSlider(mw); diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 2d2a3c5020e..cffde5f2c24 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -817,7 +817,7 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer) QList depths = picked_item_IDs.keys(); if(!depths.isEmpty()) { - qSort(depths); + std::sort(depths.begin(), depths.end()); int id = picked_item_IDs[depths.first()]; setSelectedItemIndex(id); viewer->setSelectedName(id); diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 6831ddfe75f..08f10fe568d 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -1491,7 +1491,7 @@ void Scene_c3t3_item_priv::computeIntersection(const Primitive& facet) Tr::Cell_handle ch = facet.id().first; if(intersected_cells.find(ch) == intersected_cells.end()) { - QColor c = this->colors_subdomains[ch->subdomain_index()].light(50); + QColor c = this->colors_subdomains[ch->subdomain_index()].lighter(50); const Tr::Bare_point& pa = wp2p(ch->vertex(0)->point()); const Tr::Bare_point& pb = wp2p(ch->vertex(1)->point()); @@ -1516,7 +1516,7 @@ void Scene_c3t3_item_priv::computeIntersection(const Primitive& facet) const Tr::Bare_point& pc = wp2p(nh->vertex(2)->point()); const Tr::Bare_point& pd = wp2p(nh->vertex(3)->point()); - QColor c = this->colors_subdomains[nh->subdomain_index()].light(50); + QColor c = this->colors_subdomains[nh->subdomain_index()].lighter(50); CGAL::Color color(UC(c.red()), UC(c.green()), UC(c.blue())); diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index f3e83ae55dd..40dd2d5310e 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -973,7 +973,13 @@ void Viewer::drawVisualHints() //Prints the displayMessage QFont font = QFont(); QFontMetrics fm(font); - TextItem *message_text = new TextItem(float(10 + fm.width(d->message)/2), + TextItem *message_text = new TextItem(float(10 + + #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + fm.horizontalAdvance(d->message)/2) + #else + fm.width(d->message)/2) + #endif + , float(height()-20), 0, d->message, false, QFont(), Qt::gray ); diff --git a/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.cpp b/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.cpp index 1d9eaabc9d1..dba4802cfec 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.cpp +++ b/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.cpp @@ -26,7 +26,7 @@ MainWindow::MainWindow(QWidget* parent) m_pViewer = ui->viewer; // does not save the state of the viewer - m_pViewer->setStateFileName(QString::null); + m_pViewer->setStateFileName(QString()); // accepts drop events setAcceptDrops(true); diff --git a/Three/include/CGAL/Three/TextRenderer.h b/Three/include/CGAL/Three/TextRenderer.h index d9c3417fd21..1c7905f3011 100644 --- a/Three/include/CGAL/Three/TextRenderer.h +++ b/Three/include/CGAL/Three/TextRenderer.h @@ -30,6 +30,7 @@ #include #include +#include class QVector3D; namespace CGAL{ @@ -60,7 +61,12 @@ public : :x(p_x), y(p_y), z(p_z),_3D(p_3D), _is_always_visible(always_visible), m_text(p_text), m_font(font), m_color(p_color) { QFontMetrics fm(m_font); - _width = float(fm.width(m_text)); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + _width = float(fm.horizontalAdvance(m_text)+2); +#else + _width = float(fm.width(m_text)+2); +#endif + _height = float(fm.height()); } //!\brief Accessor for the string diff --git a/Triangulation_3/demo/Triangulation_3/Viewer.cpp b/Triangulation_3/demo/Triangulation_3/Viewer.cpp index 1bf46499f87..3d3f0d54ffb 100644 --- a/Triangulation_3/demo/Triangulation_3/Viewer.cpp +++ b/Triangulation_3/demo/Triangulation_3/Viewer.cpp @@ -1766,7 +1766,7 @@ void Viewer::endSelection(const QPoint& p) QList depths = picked_IDs.keys(); if(!depths.isEmpty()) { - qSort(depths); + std::sort(depths.begin(), depths.end()); id = picked_IDs[depths.first()]; picked = true; } @@ -2267,7 +2267,7 @@ void Viewer::keyPressEvent(QKeyEvent *event) else if( m_curMode == SELECT && event->key()==Qt::Key_Delete && modifiers==Qt::NoButton ) { // sort selected id's in descending order - qSort(m_vidSeled.begin(), m_vidSeled.end(), qGreater()); + std::sort(m_vidSeled.begin(), m_vidSeled.end(), std::greater()); for(QList::iterator vit=m_vidSeled.begin(); vit Date: Wed, 10 Jul 2019 15:18:13 +0200 Subject: [PATCH 5/7] fix indentation --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index eefdf3532f3..930c3529fd2 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -2536,10 +2536,10 @@ void MainWindow::resetHeader() sceneView->header()->setSectionResizeMode(Scene::ABColumn, QHeaderView::Fixed); sceneView->header()->setSectionResizeMode(Scene::VisibleColumn, QHeaderView::Fixed); #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) - sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); - sceneView->resizeColumnToContents(Scene::RenderingModeColumn); - sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); - sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); + sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); + sceneView->resizeColumnToContents(Scene::RenderingModeColumn); + sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); + sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); #else sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().width("_#_")); sceneView->resizeColumnToContents(Scene::RenderingModeColumn); From b4c2af80fd378f0705af29a9695a148acd3cf5aa Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 10 Jul 2019 15:18:44 +0200 Subject: [PATCH 6/7] Fix indentation --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 326da8f6ead..c638e59e34e 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -2172,10 +2172,10 @@ void MainWindow::resetHeader() sceneView->header()->setSectionResizeMode(Scene::ABColumn, QHeaderView::Fixed); sceneView->header()->setSectionResizeMode(Scene::VisibleColumn, QHeaderView::Fixed); #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) - sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); - sceneView->resizeColumnToContents(Scene::RenderingModeColumn); - sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); - sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); + sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); + sceneView->resizeColumnToContents(Scene::RenderingModeColumn); + sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); + sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); #else sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().width("_#_")); sceneView->resizeColumnToContents(Scene::RenderingModeColumn); From 480256cbe192a7c97387452331510ce4c15897d7 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 11 Jul 2019 10:22:34 +0200 Subject: [PATCH 7/7] Add a #if for screenat --- GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h index 2bd20a14c9d..248def3241c 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h @@ -462,7 +462,13 @@ void DemosMainWindow::readState(QString groupname, Options /*what_to_save*/) resize(settings.value("size", this->size()).toSize()); QPoint pos = settings.value("pos", this->pos()).toPoint(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) if(QGuiApplication::screenAt(pos)) { +#else + QDesktopWidget* desktop = qApp->desktop(); + if(desktop->availableGeometry(pos).contains(pos)) { +#endif + move(pos); } QByteArray mainWindowState = settings.value("state").toByteArray();