From 2e0922f74ba527c2ee6d9226e15f5baf0f6ae4b5 2013-08-26 08:01:43 From: Titta Heikkala Date: 2013-08-26 08:01:43 Subject: [PATCH] Fix missing legend Hiding the legend items makes it impossible to print the chart with the legend when the chart is not shown. There's no need to hide the legend itmes before invalidating the layout. Task-number: QTRD-2164 Change-Id: Idad23eead869bf2f54328d35c5137326ac895c15 Reviewed-by: Miikka Heikkinen --- diff --git a/src/legend/qlegend.cpp b/src/legend/qlegend.cpp index 5fab937..2faacd3 100644 --- a/src/legend/qlegend.cpp +++ b/src/legend/qlegend.cpp @@ -407,10 +407,8 @@ void QLegend::hideEvent(QHideEvent *event) */ void QLegend::showEvent(QShowEvent *event) { - if (isAttachedToChart()) { - d_ptr->items()->setVisible(false); + if (isAttachedToChart()) layout()->invalidate(); - } QGraphicsWidget::showEvent(event); //layout activation will show the items }