I use QWebView component and I need use custom menu or disable context meny (menu with review link downloadn image, reload page and other).
I find function
bool swallowContextMenuEvent ( QContextMenuEvent * event )
but I not know how.
I use QWebView component and I need use custom menu or disable context meny (menu with review link downloadn image, reload page and other).
I find function
bool swallowContextMenuEvent ( QContextMenuEvent * event )
but I not know how.
QWebView is inherited from QWidget.
So you can override QWidget::contextMenuEvent and do what you want.
I know this. its works.
But I ask about disable context menu with use only QWebView methots.
but if this impossible np.
Because I create class based on QWebView and redeclare contextMenuEvent ( QContextMenuEvent * event )
and all works fine.
Thanks.
In that case QWidget::setContextMenuPolicy() might be of some help to you.
You can try setting it to Qt::NoContextMenu and see what happens
Bookmarks