Oh. I finally get what you mean. The key press event works for the parent
app but when the text edit has focus, it is performing its own key press
event to do the text input. Thus it is accepting your key press and it
never even reaches your parent.
You could install the parent as the event filter
Hello Justin,
I am sorry my question was not clear. My problem is that when i click the
QTextEdit and type a line and press a key in NUM pad (Eg : 0). my keypress
event is not working. its showing "0" in the QTextEdit . But if i press NUM
pad key zero, i want it actually print a sentence from
Do you mean that it does *not *work when the QTextEdit is *out of* focus?
Also a couple suggestions for that example code:
A keyPressEvent() will always receive a QKeyEvent, so you don't need to
check for it. But if you want to check an event, it is better to use this
form:
if event.type() ==
Hi All ,
I am facing a problem in KeyPressEvent. The KeyPressEvent code is as
follows.
def keyPressEvent(self, event):
keyPossiblities = ['0','1','2','3','4','5','6','7','8','9']
if type(event) == QtGui.QKeyEvent:
if self.findChildren(QtGui.QTabWidget,"TAB_CScomment