ElementEditor: decorator: got rid of calls to grabKeyboard()

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2030 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2013-02-08 22:05:22 +00:00
parent e78b0d5804
commit 47f9c5ebe6
5 changed files with 35 additions and 6 deletions

View File

@@ -220,6 +220,20 @@ void PartTextField::focusOutEvent(QFocusEvent *e) {
endEdition();
}
/**
@reimp QGraphicsTextItem::keyPressEvent()
Used to handle the escape key when the event is delivered to the field, not
to the decorator.
*/
void PartTextField::keyPressEvent(QKeyEvent *event) {
if (event -> key() == Qt::Key_Escape) {
endEdition();
}
else {
QGraphicsTextItem::keyPressEvent(event);
}
}
/**
Permet a l'element texte de devenir editable lorsqu'on double-clique dessus
@param e Le QGraphicsSceneMouseEvent qui decrit le double-clic