mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-247 Scope gadget: restore checked/unchecked state of curve legends when unhiding.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3032 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
afb7aaf374
commit
581d2497c8
@ -207,6 +207,16 @@ void ScopeGadgetWidget::addLegend()
|
||||
// legend->setFrameStyle(QFrame::Box | QFrame::Sunken);
|
||||
// insertLegend(legend, QwtPlot::BottomLegend);
|
||||
|
||||
// Update the checked/unchecked state of the legend items
|
||||
// -> this is necessary when hiding a legend where some plots are
|
||||
// not visible, and the un-hiding it.
|
||||
foreach (QwtPlotItem *item, this->itemList()) {
|
||||
bool on = item->isVisible();
|
||||
QWidget *w = legend->find(item);
|
||||
if ( w && w->inherits("QwtLegendItem") )
|
||||
((QwtLegendItem *)w)->setChecked(!on);
|
||||
}
|
||||
|
||||
connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool)), this, SLOT(showCurve(QwtPlotItem *, bool)));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user