| 37 | } |
| 38 | |
| 39 | View::~View() |
| 40 | { |
| 41 | Q_D(View); |
| 42 | |
| 43 | // widget is a raw pointer cache that prevents repeated weak pointer access |
| 44 | auto* const widget = d->widget.get(); |
| 45 | if (widget && d->ws == View::TakeOwnership) { |
| 46 | widget->hide(); |
| 47 | widget->setParent(nullptr); |
| 48 | delete widget; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | Document *View::document() const |
| 53 | { |