| 106 | } |
| 107 | |
| 108 | void PlotLegend::removeChannel(PlotChannel *ch) |
| 109 | { |
| 110 | if(!m_entries.contains(ch)) { |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | disconnect(ch, &PlotChannel::enabledChanged, this, &PlotLegend::updateStyles); |
| 115 | disconnect(ch, &PlotChannel::thicknessChanged, this, nullptr); |
| 116 | disconnect(ch, &PlotChannel::styleChanged, this, nullptr); |
| 117 | disconnect(ch, &PlotChannel::nameChanged, this, nullptr); |
| 118 | |
| 119 | QWidget *entry = m_entries.take(ch); |
| 120 | m_labels.remove(ch); |
| 121 | m_colorLines.remove(ch); |
| 122 | m_legendLayout->removeWidget(entry); |
| 123 | entry->deleteLater(); |
| 124 | } |
| 125 | |
| 126 | void PlotLegend::updateStyles() |
| 127 | { |
nothing calls this directly
no test coverage detected