MCPcopy Create free account
hub / github.com/KDE/labplot / deleteView

Method deleteView

src/backend/core/AbstractPart.cpp:93–109  ·  view source on GitHub ↗

! * 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. */

Source from the content-addressed store, hash-verified

91 * is closed (=deleted) in MainWindow. Makes sure that the view also gets deleted.
92 */
93void 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.

Callers 2

~DatapickerViewMethod · 0.80
~WorkbookViewMethod · 0.80

Calls 2

parentAspectMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected