I keep on trying to spot the problem. I have created my own class by mean of:
class TextEditor(QtGui.QPlainTextEdit):
class TextEditor(QtGui.QPlainTextEdit):
To copy to clipboard, switch view to plain text mode
and I have implemented my own event function which captures key presses:
def event(self, event):
if event.
type() == QtCore.
QEvent.
KeyPress: if event.key()==QtCore.Qt.Key_Tab:
self.key_tab_pressed.emit()
return True
.....
def event(self, event):
if event.type() == QtCore.QEvent.KeyPress:
if event.key()==QtCore.Qt.Key_Tab:
self.key_tab_pressed.emit()
return True
.....
To copy to clipboard, switch view to plain text mode
When I hide most of the text (>80000 blocks) the profiler shows that the event function is called >81000 times taking 0.7sg per call. The cumulative time is about 340sg.
Is there any way to avoid this events to be produced?
Regards,
José M.
Bookmarks