Hi wysota!

Thanks for your reply. Unfortunately, I am unable to turn your suggestion into working code. I tried:

Qt Code:
  1. bool MyQPlaintTextEditor::eventFilter(QObject* obj, QEvent* event) {
  2. if (event->type() == QEvent::KeyPress) {
  3. QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
  4.  
  5. if ((keyEvent->modifiers() == 0) && (keyEvent->text() != "0") && (keyEvent->text() != "1")) {
  6. return true;
  7. }
  8. }
  9.  
  10. // standard event processing
  11. return QObject::eventFilter(obj, event);
  12. }
To copy to clipboard, switch view to plain text mode 

I still can e.g. press AltGr-0 and get a "}" -> AltGr doesn't seem to be catched by modifiers(). Besides that, the code above doesn't allow me to navigate with cursor keys or use backspace. Do I really have to check all those keycodes and let them though? This seems odd to me. But as I said already: I think that playing with the key codes it too low level for my purpose...

Any other ideas? Thanks a lot!

Regards,
Paul