| 1052 | } |
| 1053 | |
| 1054 | QCPLayer::~QCPLayer() |
| 1055 | { |
| 1056 | // If child layerables are still on this layer, detach them, so they don't try to reach back to this |
| 1057 | // then invalid layer once they get deleted/moved themselves. This only happens when layers are deleted |
| 1058 | // directly, like in the QCustomPlot destructor. (The regular layer removal procedure for the user is to |
| 1059 | // call QCustomPlot::removeLayer, which moves all layerables off this layer before deleting it.) |
| 1060 | |
| 1061 | while (!mChildren.isEmpty()) |
| 1062 | mChildren.last()->setLayer(0); // removes itself from mChildren via removeChild() |
| 1063 | |
| 1064 | if (mParentPlot->currentLayer() == this) |
| 1065 | qDebug() << Q_FUNC_INFO << "The parent plot's mCurrentLayer will be a dangling pointer. Should have been set to a valid layer or 0 beforehand."; |
| 1066 | } |
| 1067 | |
| 1068 | /*! |
| 1069 | Sets whether this layer is visible or not. If \a visible is set to false, all layerables on this |
nothing calls this directly
no test coverage detected