! Sets the layer with the specified \a name to be the current layer. All layerables (\ref QCPLayerable), e.g. plottables and items, are created on the current layer. Returns true on success, i.e. if there is a layer with the specified \a name in the QCustomPlot. Layer names are case-sensitive. \see addLayer, moveLayer, removeLayer, QCPLayerable::setLayer */
| 14012 | \see addLayer, moveLayer, removeLayer, QCPLayerable::setLayer |
| 14013 | */ |
| 14014 | bool QCustomPlot::setCurrentLayer(const QString &name) |
| 14015 | { |
| 14016 | if (QCPLayer *newCurrentLayer = layer(name)) |
| 14017 | { |
| 14018 | return setCurrentLayer(newCurrentLayer); |
| 14019 | } else |
| 14020 | { |
| 14021 | qDebug() << Q_FUNC_INFO << "layer with name doesn't exist:" << name; |
| 14022 | return false; |
| 14023 | } |
| 14024 | } |
| 14025 | |
| 14026 | /*! \overload |
| 14027 |