! * this function is called when PartMdiView, the mdi-subwindow-wrapper of the actual view, * is closed (=deleted) in MainWindow. Makes sure that the view also gets deleted. */
| 91 | * is closed (=deleted) in MainWindow. Makes sure that the view also gets deleted. |
| 92 | */ |
| 93 | void AbstractPart::deleteView() const { |
| 94 | // if the parent is a Workbook or Datapicker, the actual view was already deleted when QTabWidget was deleted. |
| 95 | // here just set the pointer to 0. |
| 96 | auto* parent = parentAspect(); |
| 97 | auto type = parent->type(); |
| 98 | if (type == AspectType::Workbook || type == AspectType::Datapicker |
| 99 | || (parent->parentAspect() && parent->parentAspect()->type() == AspectType::Datapicker)) { |
| 100 | m_partView = nullptr; |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | if (m_partView) { |
| 105 | Q_EMIT viewAboutToBeDeleted(); |
| 106 | delete m_partView; |
| 107 | m_partView = nullptr; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * \brief Return AbstractAspect::createContextMenu() plus operations on the primary view. |
no test coverage detected