Yes, I am doing exactly this. There is no point pasting my code here, it's like yours.

What I am trying to do is, to create sth like a console, like a linux console.
So, in my main window, I have a new class that inherits QTextEdit, e.g QConsole.

I reimplement keyPressEvent() function for QConsole as you told me, so I do QConsole::keyPressEvent(){...what you wrote...}. When I add the if statement for Qt::Key_Return, it works perfect. Also, when I add some other key stroke event, it works perfect. Howeve if I don't add them, key strokes don't take their default use.

For example, if I add only Key_Return if statement, the window responds only when I press the return key. All the other don't do anything. When I reimplement keyPressEvent, the other keys don't keep their usual functionality? Is there any way to make them to keep their functionality and change only what I want?

Finally, I don;t see, why I should pass it to some parent widget. The parent widget of the QConsole is just a widget, but ok, I can't see the relation. The thing is tha keyPressEvent suffers.