From 05fa3caa787974595a2692f708a75813a515adda 2015-09-04 08:49:06 From: Miikka Heikkinen Date: 2015-09-04 08:49:06 Subject: [PATCH] Don't reserve space for chart title if it is empty. If title.isEmpty() returns true, chart title is no longer reserved any space. If you want to reserve space for "empty" title in the future, you can do so by specifying e.g. a single space for title. Task-number: QTRD-3480 Change-Id: I5b2b44acf715b3bd9b4243049c4985ca63a4a16d Reviewed-by: Titta Heikkala --- diff --git a/src/charts/layout/abstractchartlayout.cpp b/src/charts/layout/abstractchartlayout.cpp index 119ea3c..3215898 100644 --- a/src/charts/layout/abstractchartlayout.cpp +++ b/src/charts/layout/abstractchartlayout.cpp @@ -54,7 +54,7 @@ void AbstractChartLayout::setGeometry(const QRectF &rect) contentGeometry = calculateContentGeometry(contentGeometry); - if (title && title->isVisible()) + if (title && title->isVisible() && !title->text().isEmpty()) contentGeometry = calculateTitleGeometry(contentGeometry, title); if (legend->isAttachedToChart() && legend->isVisible())