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

Method deleteElement

src/frontend/worksheet/WorksheetView.cpp:1427–1447  ·  view source on GitHub ↗

! * deletes selected worksheet elements */

Source from the content-addressed store, hash-verified

1425 * deletes selected worksheet elements
1426 */
1427void WorksheetView::deleteElement() {
1428 if (m_selectedItems.isEmpty())
1429 return;
1430
1431 auto status = KMessageBox::warningTwoActions(
1432 this,
1433 i18np("Do you really want to delete the selected object?", "Do you really want to delete the selected %1 objects?", m_selectedItems.size()),
1434 i18np("Delete selected object", "Delete selected objects", m_selectedItems.size()),
1435 KStandardGuiItem::del(),
1436 KStandardGuiItem::cancel());
1437 if (status == KMessageBox::SecondaryAction)
1438 return;
1439
1440 m_suppressSelectionChangedEvent = true;
1441 m_worksheet->beginMacro(i18n("%1: Remove selected worksheet elements.", m_worksheet->name()));
1442 for (auto* item : m_selectedItems)
1443 m_worksheet->deleteAspectFromGraphicsItem(item);
1444 m_selectedElement = nullptr;
1445 m_worksheet->endMacro();
1446 m_suppressSelectionChangedEvent = false;
1447}
1448
1449void WorksheetView::aspectAboutToBeRemoved(const AbstractAspect* /* aspect */) {
1450 /*

Callers

nothing calls this directly

Calls 6

beginMacroMethod · 0.80
endMacroMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected