[PyQt] handling Enter in a qtextedit?
inhahe at gmail.com
Tue Sep 8 06:55:40 BST 2009
The documentation for keyPressEvent for a QTextEdit says
This function is called with key event *e* when key presses occur. It
handles PageUp, PageDown, Up, Down, Left, and Right, and ignores all other
i guess that means if i want to react to a user pressing Enter they're not
making it easy for me?
i thought maybe i could handle the textChanged event and then grab the
current state of the keyboard to see if Enter is pressed, but I don't
even see a function to check the keyboard state.
so what's the best way to do this?
do I have to use QAction in some way?
what i want to do specifically is create an edit box where pressing
shift+enter works like pressing enter but pressing enter alone calls a
function which clears the text, etc. just like how an AIM input box works.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt