Remove double entry for edit element, and remove the entry : selection property

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3739 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-02-20 18:44:44 +00:00
parent 5e3b84aaf8
commit 6eabfb60d4
3 changed files with 43 additions and 28 deletions

View File

@@ -1088,11 +1088,17 @@ bool DiagramView::selectedItemHasFocus() {
void DiagramView::editSelection() {
if (scene -> isReadOnly() || scene -> selectedItems().size() != 1 ) return;
if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(scene->selectedItems().first())) {
QGraphicsItem *item = scene->selectedItems().first();
//We use dynamic_cast instead of qgraphicsitem_cast for QetGraphicsItem
//because they haven't got they own type().
//Use qgraphicsitem_cast will have weird behavior for this class.
if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
iti -> edit();
} else if (QetGraphicsItem *qgi = qgraphicsitem_cast<QetGraphicsItem *> (scene->selectedItems().first())) {
else if (QetGraphicsItem *qgi = dynamic_cast<QetGraphicsItem *> (item))
qgi -> editProperty();
}
else if (Conductor *c = qgraphicsitem_cast<Conductor *>(item))
c -> editProperty();
}
/**