+ QLineEdit* aLineEdit = dynamic_cast<QLineEdit*>(theObject);
+ return aLineEdit;
+}
+
+bool XGUI_OperationMgr::onProcessDelete(QObject* theObject)
+{
+ bool isAccepted = false;
+ ModuleBase_Operation* aOperation = currentOperation();
+ ModuleBase_ModelWidget* anActiveWgt = 0;
+ // firstly the widget should process Delete action
+ ModuleBase_IPropertyPanel* aPanel;
+ bool isPPChildObject = false;
+ if (aOperation) {
+ aPanel = aOperation->propertyPanel();
+ if (aPanel) {
+ isPPChildObject = isChildObject(theObject, aPanel);
+ // process delete in active widget only if delete sender is child of property panel
+ // it is necessary for the case when OB is shown, user perform selection and click Delete
+ if (isPPChildObject) {
+ anActiveWgt = aPanel->activeWidget();
+ if (anActiveWgt) {
+ isAccepted = anActiveWgt->processDelete();
+ }
+ }
+ }
+ }
+ if (!isAccepted) {
+ // after widget, object browser and viewer should process delete
+ /// other widgets such as line edit controls should not lead to
+ /// processing delete by workshop
+ XGUI_ObjectsBrowser* aBrowser = XGUI_Tools::workshop(myWorkshop)->objectBrowser();
+ QWidget* aViewPort = myWorkshop->viewer()->activeViewPort();
+ bool isToDeleteObject = false;
+ XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
+ XGUI_ContextMenuMgr* aContextMenuMgr = aWorkshop->contextMenuMgr();
+ if (theObject == aBrowser->treeView()) {
+ aContextMenuMgr->updateObjectBrowserMenu();
+ isToDeleteObject = aContextMenuMgr->action("DELETE_CMD")->isEnabled();
+ }
+ else if (isChildObject(theObject, aViewPort)) {
+ aContextMenuMgr->updateViewerMenu();
+ isToDeleteObject = aContextMenuMgr->action("DELETE_CMD")->isEnabled();
+ }
+ else if (isPPChildObject) {
+ // property panel child object is processed to process delete performed on Apply button of PP
+ isToDeleteObject = true;
+ }
+ else if (editorControl(theObject)) {
+ isToDeleteObject = false; /// Line Edit of Rename operation in ObjectBrowser
+ isAccepted = true;
+ }
+
+ if (isToDeleteObject) {
+ aWorkshop->deleteObjects();
+ isAccepted = true;
+ }
+ }
+
+ return isAccepted;