Quote Originally Posted by stan_fr View Post
Well : it would be a very clever solution but QTextEdit does not have any signal related to mouse buttons ...
It does (somewhat) and it's called customContextMenuRequested().

I can find in which QTextEdit I am by mapping the cursor position to global coordinates and finding which QTextEdit it belongs to but I envisonned something "cleaner" ...
Qt Code:
  1. void MyWidget::showContextMenu(const QPoint &p)
  2. {
  3. QTextEdit *editor = qobject_cast<QTextEdit *>(sender());
  4. if (!editor)
  5. return;
  6. //...
  7. }
To copy to clipboard, switch view to plain text mode