def focusInEvent (self, event): '''Re-implementation of the QGraphicsTextItem's method focusOInEvent in order to change the text colour to red. @param event event ''' self.setDefaultTextColor (Qt.red) QGraphicsTextItem.focusOutEvent(self, event)
def focusOutEvent (self, event): '''Re-implementation of the QGraphicsTextItem's method focusOutEvent in order to provide QGraphicsTextItem with the QLineEdit's textChanged Event. @param event event ''' self.emit (SIGNAL ('textChanged(QString)'), QString(self.toPlainText())) self.setDefaultTextColor (QColor (Qt.white).light (255)) QGraphicsTextItem.focusOutEvent(self, event)