mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 09:40:52 +01:00
Disable deletion if a terminal can't be deleted.
In case of user try to delete a terminal element who is bridged or belong to a physical terminal with more than one level, the deletion is aborted to avoid mistake in the terminal strip parent of the terminal element. A dialog is opened when the deletion can't be to explain to user what to do for enable the deletion.
This commit is contained in:
@@ -59,7 +59,15 @@ DiagramContent::DiagramContent(Diagram *diagram, bool selected) :
|
||||
{
|
||||
switch (item->type())
|
||||
{
|
||||
case Element::Type: { m_elements << qgraphicsitem_cast<Element *>(item); break;}
|
||||
case Element::Type:
|
||||
{
|
||||
auto element = qgraphicsitem_cast<Element *>(item);
|
||||
m_elements << element;
|
||||
if (element->elementData().m_type == ElementData::Terminale) {
|
||||
m_terminal_elements << static_cast<TerminalElement*>(element);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IndependentTextItem::Type: { m_text_fields << qgraphicsitem_cast<IndependentTextItem *>(item); break;}
|
||||
case Conductor::Type:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user