From c3857db23bdd21469762ea1a5b6f2f20a52ca15e Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sun, 8 Oct 2017 21:43:30 +0200 Subject: [PATCH] Hide outdated gas name strings in profile in planner When deleting dive planner points in the planner we currently sometimes miss to hide the outdated gas name strings printed close to the profile legs. Signed-off-by: Stefan Fuchs --- profile-widget/profilewidget2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index e87620c9a..1d25c8261 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1756,6 +1756,9 @@ void ProfileWidget2::pointsRemoved(const QModelIndex &, int start, int end) void ProfileWidget2::repositionDiveHandlers() { DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); + #define HIDE_ALL(TYPE, CONTAINER) \ + Q_FOREACH (TYPE *item, CONTAINER) item->setVisible(false); + HIDE_ALL(QGraphicsSimpleTextItem, gases); // Re-position the user generated dive handlers for (int i = 0; i < plannerModel->rowCount(); i++) { struct divedatapoint datapoint = plannerModel->at(i);