mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user