How to edit QtWebKit's right-click context menu in Qt Creator?

一个人想着一个人 提交于 2019-12-04 13:03:47

The QWidget::contextMenuEvent( QContextMenuEvent * event ) is a "virtual protected" function.
You can inherit the QWebView, and then override "contextMenuEvent".

If what you need is just to handle "Open in New Window" action, I suggest to reimplement virtual protected QWebView::createWindow. Reimplementing contextMenuEvent from scratch could be complicated without using createStandardContextMenu, which directs "Open in New Window" to createWindow.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!