| 207 | } |
| 208 | |
| 209 | Project::~Project() { |
| 210 | Q_D(Project); |
| 211 | Q_EMIT aboutToClose(); |
| 212 | #ifndef SDK |
| 213 | // if the project is being closed and the live data sources still continue reading the data, |
| 214 | // the dependent objects (columns, etc.), which are already deleted maybe here, are still being notified about the changes. |
| 215 | //->stop reading the live data sources prior to deleting all objects. |
| 216 | for (auto* lds : children<LiveDataSource>()) |
| 217 | lds->pauseReading(); |
| 218 | |
| 219 | #ifdef HAVE_MQTT |
| 220 | for (auto* client : children<MQTTClient>()) |
| 221 | client->pauseReading(); |
| 222 | #endif |
| 223 | #endif |
| 224 | // if the project is being closed, in Worksheet the scene items are being removed and the selection in the view can change. |
| 225 | // don't react on these changes since this can lead crashes (worksheet object is already in the destructor). |
| 226 | //->notify all worksheets about the project being closed. |
| 227 | for (auto* w : children<Worksheet>(ChildIndexFlag::Recursive)) |
| 228 | w->setIsClosing(); |
| 229 | |
| 230 | d->undo_stack.clear(); |
| 231 | delete d; |
| 232 | } |
| 233 | |
| 234 | QString Project::version() { |
| 235 | return ProjectPrivate::version(); |
nothing calls this directly
no test coverage detected