Hi all,

For 2 days I'm fighting with QTextEdit to disable pasting. I disabled Ctrl+P by keyPressEvent().
I don't know how to grab Middle Mouse Button (linux shortcut fo paste).
Qt Code:
  1. void Edytor::mousePressEvent ( QMouseEvent * e ) {
  2.  
  3. if(e->button()==(Qt::MidButton)){
  4. qDebug()<<"middle";
  5. e->accept();
  6. return;
  7. };
  8. QTextEdit::mousePressEvent(e);
  9. };
To copy to clipboard, switch view to plain text mode 

When I use above it shows 'middle' but also takes default action (pastes text).
Any idea?