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

Method aspectAdded

src/frontend/worksheet/WorksheetPreviewWidget.cpp:141–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141void WorksheetPreviewWidget::aspectAdded(const AbstractAspect* aspect) {
142 if (m_project->isLoading())
143 return;
144
145 const auto* w = dynamic_cast<const Worksheet*>(aspect);
146 if (w) {
147 addPreview(w, indexOfWorksheet(w));
148 return;
149 }
150
151 // in case a folder was added (copy&paste, duplicate, project import), check whether it has worksheets
152 // and add previews for them
153 const auto* folder = dynamic_cast<const Folder*>(aspect);
154 if (folder) {
155 QTimer::singleShot(0, this, [=]() {
156 const auto& worksheets = folder->children<Worksheet>(AbstractAspect::ChildIndexFlag::Recursive);
157 for (const auto* w : worksheets)
158 addPreview(w, indexOfWorksheet(w));
159 });
160 }
161}
162
163void WorksheetPreviewWidget::aspectSelected(const AbstractAspect* aspect) {
164 if (!m_project)

Callers

nothing calls this directly

Calls 1

isLoadingMethod · 0.80

Tested by

no test coverage detected