@@ -176,6 +176,7 d_ptr(new QLegendPrivate(chart->d_ptr->m_presenter,chart,this)) | |||||
176 | QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesRemoved(QAbstractSeries*)),d_ptr.data(),SLOT(handleSeriesRemoved(QAbstractSeries*))); |
|
176 | QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesRemoved(QAbstractSeries*)),d_ptr.data(),SLOT(handleSeriesRemoved(QAbstractSeries*))); | |
177 | QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesUpdated(QAbstractSeries*)),d_ptr.data(),SLOT(handleSeriesUpdated(QAbstractSeries*))); |
|
177 | QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesUpdated(QAbstractSeries*)),d_ptr.data(),SLOT(handleSeriesUpdated(QAbstractSeries*))); | |
178 | setLayout(d_ptr->m_layout); |
|
178 | setLayout(d_ptr->m_layout); | |
|
179 | setVisible(false); | |||
179 | } |
|
180 | } | |
180 |
|
181 | |||
181 | /*! |
|
182 | /*! | |
@@ -192,6 +193,7 void QLegend::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q | |||||
192 | { |
|
193 | { | |
193 | Q_UNUSED(option) |
|
194 | Q_UNUSED(option) | |
194 | Q_UNUSED(widget) |
|
195 | Q_UNUSED(widget) | |
|
196 | ||||
195 | if(!d_ptr->m_backgroundVisible) return; |
|
197 | if(!d_ptr->m_backgroundVisible) return; | |
196 |
|
198 | |||
197 | painter->setOpacity(opacity()); |
|
199 | painter->setOpacity(opacity()); | |
@@ -412,8 +414,10 void QLegend::hideEvent(QHideEvent *event) | |||||
412 | */ |
|
414 | */ | |
413 | void QLegend::showEvent(QShowEvent *event) |
|
415 | void QLegend::showEvent(QShowEvent *event) | |
414 | { |
|
416 | { | |
415 | d_ptr->m_presenter->layout()->invalidate(); |
|
|||
416 | QGraphicsWidget::showEvent(event); |
|
417 | QGraphicsWidget::showEvent(event); | |
|
418 | d_ptr->m_presenter->layout()->invalidate(); | |||
|
419 | d_ptr->items()->setVisible(false); | |||
|
420 | //layout activation will show the items | |||
417 | } |
|
421 | } | |
418 |
|
422 | |||
419 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
423 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
General Comments 0
You need to be logged in to leave comments.
Login now