<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hello guys<DIV><BR class="khtml-block-placeholder"></DIV><DIV>When I try to get KeyEvent.text() on a keyReleaseEvent inside a QTextEdit it is empty.</DIV><DIV>Any of you has experienced this before? On Windows it works, but  not on Mac.</DIV><DIV>I am using PyQt-mac-gpl-4.0 and Qt 4.1.3</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here it is a small program to test.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>import sys</DIV><DIV>from PyQt4 import QtGui, QtCore</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>class myDialog(QtGui.QDialog):</DIV><DIV>    def __init__(self, parent=None):</DIV><DIV>        QtGui.QDialog.__init__(self, parent)</DIV><DIV>        self.text = myTextEdit(self)</DIV><DIV>        self.text.setReadOnly(False)</DIV><DIV>        layout = QtGui.QHBoxLayout()</DIV><DIV>        layout.addWidget(self.text)</DIV><DIV>        self.setLayout(layout)</DIV><DIV>        self.resize(300,300)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>class myTextEdit(QtGui.QTextEdit):</DIV><DIV>    def __init__(self, parent):</DIV><DIV>        QtGui.QTextEdit.__init__(self,parent)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    def keyPressEvent(self, e):</DIV><DIV>        print "keyPressEvent", str(e.text())</DIV><DIV>        QtGui.QTextEdit.keyPressEvent(self,e)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    def keyReleaseEvent(self, e):</DIV><DIV>        print "keyReleaseEvent", str(e.text())</DIV><DIV>        QtGui.QTextEdit.keyReleaseEvent(self,e)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>if __name__ == '__main__':</DIV><DIV>    app = QtGui.QApplication(sys.argv)</DIV><DIV>    dialog = myDialog()</DIV><DIV>    sys.exit(dialog.exec_())</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- Emanuele </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></DIV></BODY></HTML>