| 1077 | } |
| 1078 | |
| 1079 | QCPLayer::~QCPLayer() |
| 1080 | { |
| 1081 | // If child layerables are still on this layer, detach them, so they don't try to reach back to this |
| 1082 | // then invalid layer once they get deleted/moved themselves. This only happens when layers are deleted |
| 1083 | // directly, like in the QCustomPlot destructor. (The regular layer removal procedure for the user is to |
| 1084 | // call QCustomPlot::removeLayer, which moves all layerables off this layer before deleting it.) |
| 1085 | |
| 1086 | while (!mChildren.isEmpty()) |
| 1087 | mChildren.last()->setLayer(nullptr); // removes itself from mChildren via removeChild() |
| 1088 | |
| 1089 | if (mParentPlot->currentLayer() == this) |
| 1090 | qDebug() << Q_FUNC_INFO << "The parent plot's mCurrentLayer will be a dangling pointer. Should have been set to a valid layer or nullptr beforehand."; |
| 1091 | } |
| 1092 | |
| 1093 | /*! |
| 1094 | 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