From e2168840d81f0074c6f9dc70d3372f71b42a0e55 2013-11-01 07:41:58 From: Titta Heikkala Date: 2013-11-01 07:41:58 Subject: [PATCH] Fix legend drawing on font change The legend items are hidden when the font is changed to avoid flashing on update. The correct visibility is set for legend items when new geometry is set for LegendLayout. Task-number: QTRD-2523 Change-Id: If5907a1c4d7fa538a08d628c30972f2d0fa3ed84 Reviewed-by: Miikka Heikkinen --- diff --git a/src/legend/qlegend.cpp b/src/legend/qlegend.cpp index a8c12f5..199409e 100644 --- a/src/legend/qlegend.cpp +++ b/src/legend/qlegend.cpp @@ -247,6 +247,8 @@ QPen QLegend::pen() const void QLegend::setFont(const QFont &font) { if (d_ptr->m_font != font) { + // Hide items to avoid flickering + d_ptr->items()->setVisible(false); d_ptr->m_font = font; foreach (QLegendMarker *marker, d_ptr->markers()) { marker->setFont(d_ptr->m_font);