| 219 | } |
| 220 | |
| 221 | void PlotNavigator::removeNavigators(QwtAxisId axisId, PlotChannel *channel) |
| 222 | { |
| 223 | // remove axes if there aren't other channels using them |
| 224 | bool found = false; |
| 225 | |
| 226 | for(PlotChannel *ch : *m_channels) { |
| 227 | if((ch->xAxis()->axisId() == axisId) || (ch->yAxis()->axisId() == axisId)) { |
| 228 | found = true; |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | QList<Navigator *> toDelete; |
| 233 | for(Navigator *nav : *m_navigators) { |
| 234 | if((!found && nav->magnifier->getXAxis() == axisId) || |
| 235 | (!found && nav->magnifier->getYAxis() == axisId)) { |
| 236 | toDelete.push_back(nav); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | for(Navigator *n : toDelete) { |
| 241 | m_navigators->remove(n); |
| 242 | delete n; |
| 243 | m_axes->remove(axisId); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | void PlotNavigator::onReset() |
| 248 | { |