Code: Select all
You cannot delete the anchor view of a projection group.
It would be great if I just select the line/vertex and press "Delete" to delete it. Or double click the line to change its appearance instead of going into the menu.
Code: Select all
You cannot delete the anchor view of a projection group.
The ViewProvider is the link between the App side and the Gui side. The ViewProvider performs scene graph manipulation in the Coin3d world. In TechDraw the ViewProvider calls QGIV* to perform the drawing.bensay wrote: ↑Sat Jul 15, 2023 1:27 pm I tried looking at this, but when selecting a cosmetic vertex and pressing delete, MDIViewPage::onDeleteObject is called with the view and not the vertex. Why is this? Is it because it doesn't have a view provider?
In general, what is a viewprovider and why is everything going through the view provider? Like startDefaultEditMode
It looks like ShortcutManager.cpp traps DEL and invokes Std_Delete process which eventually gets to onDeleteObject. There is no sub-element because Std_Delete only deals with DocumentObjects.bensay wrote: ↑Sun Jul 16, 2023 6:05 pm It seems as MDIViewPage::onDeleteObject currently handles all deletions. Are you sure it's supposed to travel up the stack if there is no event filter? Currently, it doesn't seem to be a Qt event but a FreeCAD call such that it works together with App.getDocument('PartDesignExample').removeObject('View') command.
Hmmm... if I try to delete a dimension, MDIViewPage::onDeleteObject is called with the dimension as argument. If I try to delete a vertex, MDIViewPage::onDeleteObject is called with the view as parameter... why isn't the vertex passed as parameter?
Code: Select all
Gui::ResolveMode resolve = Gui::ResolveMode::OldStyleElement;//mystery
bool single = false;
auto selection = Gui::Selection().getSelectionEx(nullptr, App::DocumentObject::getClassTypeId(),
resolve, single);
if (!selection.empty()) {
auto firstObject = selection.front().getObject();
Base::Console().Message("MDIVP::onDeleteObject - obj: %s\n", firstObject->getNameInDocument());
if (!selection.front().getSubNames().empty()) {
auto firstSub = selection.front().getSubNames().front();
Base::Console().Message("MDIVP::onDeleteObject - subs: %s\n", firstSub.c_str());
}
}