From b4c2af80fd378f0705af29a9695a148acd3cf5aa Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 10 Jul 2019 15:18:44 +0200 Subject: [PATCH 1/2] 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 2/2] 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();