Texts group can be removed with the delete key of keybord

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5142 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-12-05 21:41:29 +00:00
parent 89c019a10e
commit e8905793cc
7 changed files with 61 additions and 45 deletions

View File

@@ -174,6 +174,31 @@ QList<Conductor *> DiagramContent::conductors(int filter) const
return(result.toList());
}
/**
* @brief DiagramContent::hasDeletableItems
* @return true if this diagram content have deletable item
* The deletable items correspond to the selected items of diagram
* at the moment of the creation of this DiagramContent,
* with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
*/
bool DiagramContent::hasDeletableItems() const
{
for(QGraphicsItem *qgi : m_selected_items)
{
if (qgi->type() == Element::Type ||
qgi->type() == Conductor::Type ||
qgi->type() == IndependentTextItem::Type ||
qgi->type() == QetShapeItem::Type ||
qgi->type() == DiagramImageItem::Type ||
qgi->type() == DynamicElementTextItem::Type)
return true;
if(qgi->type() == QGraphicsItemGroup::Type)
if(dynamic_cast<ElementTextItemGroup *>(qgi))
return true;
}
return(false);
}
/**
* @brief DiagramContent::clear
* Remove all items from the diagram content