1 // actionmodifydeletequick.cpp
3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 06/04/2010 Added this text. :-)
17 #include "actionmodifydeletequick.h"
20 #include "dialogfactory.h"
21 #include "graphicview.h"
23 ActionModifyDeleteQuick::ActionModifyDeleteQuick(
24 EntityContainer & container, GraphicView & graphicView):
25 ActionInterface("Quick Delete Entities", container, graphicView)
30 ActionModifyDeleteQuick::~ActionModifyDeleteQuick()
35 * Deletes all entities that were selected.
37 void ActionModifyDeleteQuick::trigger()
39 DEBUG->print("ActionModifyDeleteQuick::trigger()");
43 DEBUG->print("Entity found");
44 EntityContainer * parent = en->getParent();
48 en->setSelected(false);
49 #warning "!!! Old rendering path need upgrade !!!"
51 graphicView->deleteEntity(en);
53 en->changeUndoState();
57 document->startUndoCycle();
58 document->addUndoable(en);
59 document->endUndoCycle();
63 DIALOGFACTORY->updateSelectionWidget(container->countSelected());
66 DEBUG->print("ActionModifyDeleteQuick::mousePressEvent:"
70 void ActionModifyDeleteQuick::mouseReleaseEvent(QMouseEvent * e)
72 if (e->button() == Qt::RightButton)
73 init(getStatus() - 1);
81 void ActionModifyDeleteQuick::updateMouseButtonHints()
86 DIALOGFACTORY->updateMouseWidget(tr("Pick entity to delete"),
91 DIALOGFACTORY->updateMouseWidget("", "");
96 void ActionModifyDeleteQuick::updateMouseCursor()
98 graphicView->setMouseCursor(RS2::DelCursor);