Created attachment 89752 [details]
Example to reproduce the problem
When the page of a QGraphicsWebView is set as editable (page()->setContentEditable(true)) and the user selects some text, opening the context menu causes the selected text to get removed from the page.
Steps to reproduce:
- Compile and run the attached example
- Select some text
- Right-click it to open the context menu
Actual behaviour: The selected text is removed
Expected behaviour: The selected text shouldn't be removed
Apparently, the bug can be workarounded by calling setContentEditable(false) right before opening the context menu, then calling setContentEditable(true) after the menu is closed.
I forgot to mention it happens with Qt 4.7.2.
Actually the problem seems to be broader. The selection is cleared whenever the view loses its focus. For example, if I select some text and switch to another application, then come back, the selection has been removed as well.
*** This bug has been marked as a duplicate of bug 50116 ***