Quote Originally Posted by Kryzon View Post
Try the following: just create a copy of the event with the Text property in uppercase version and pass it to the base implementation.

Qt Code:
  1. void MyLineEdit::keyPressEvent( QKeyEvent* event )
  2. {
  3. event.accept();
  4.  
  5. QKeyEvent* modifiedEvent = new QKeyEvent( QEvent::KeyPress, event->key(), event->modifiers(), event->text().toUpper() );
  6. QLineEdit::keyPressEvent( modifiedEvent );
  7. }
To copy to clipboard, switch view to plain text mode 
To quote myself as I can't edit that post, instead of creating the event in the heap like that (which is flawed in that it should lead to a leak), creating it in the stack is the right way.

Qt Code:
  1. QKeyEvent modifiedEvent( QEvent::KeyPress, event->key(), event->modifiers(), event->text().toUpper() );
  2. QLineEdit::keyPressEvent( &modifiedEvent );
To copy to clipboard, switch view to plain text mode 
The temporary event will be destroyed after the base implementation processes it.