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") :
                if event.key() < 255 :
                    if chr(event.key())in keyPossiblities :
                        prvTxt = self.textFLD 
[str(self.clickedFileName)].toPlainText()
                        self.textFLD 
[str(self.clickedFileName)].setHtml("%s %s" % (prvTxt, 
self.preDefComments[chr(event.key())])) 
                    event.accept()
        else:
            event.ignore()
 
It actually fills a QTextEdit with some comments from a text file when the 
user press NUM keys in keyboard (0-9). Everything is working fine as 
excepted. But when the text is on focus the KeyPressEvent is not working. 
Can anyone give me a solution to overcome this issue.
 
Thanks and Regards,
Sudeepth Patinjarayil.

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to