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