Commit 810ae40e authored by hausmann@webkit.org's avatar hausmann@webkit.org

2008-06-23 Benjamin C Meyer <ben@meyerhome.net>

        Reviewed by Simon.

        Add function to retrieve the standard context menu

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b6e784f0
......@@ -464,13 +464,27 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
void QWebPagePrivate::contextMenuEvent(QContextMenuEvent *ev)
{
if (currentContextMenu) {
currentContextMenu->exec(ev->globalPos());
delete currentContextMenu;
currentContextMenu = 0;
QMenu *menu = q->createStandardContextMenu();
if (menu) {
menu->exec(ev->globalPos());
delete menu;
}
}
/*!
\since 4.5
This function creates the standard context menu which is shown when
the user clicks on the web page with the right mouse button. It is
called from the default contextMenuEvent() handler. The popup menu's
ownership is transferred to the caller.
*/
QMenu *QWebPage::createStandardContextMenu()
{
QMenu *menu = d->currentContextMenu;
d->currentContextMenu = 0;
return menu;
}
void QWebPagePrivate::wheelEvent(QWheelEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
......
......@@ -31,6 +31,7 @@ QT_BEGIN_NAMESPACE
class QNetworkProxy;
class QUndoStack;
class QUrl;
class QMenu;
class QNetworkRequest;
class QNetworkReply;
class QNetworkAccessManager;
......@@ -228,6 +229,8 @@ public:
bool swallowContextMenuEvent(QContextMenuEvent *event);
void updatePositionDependentActions(const QPoint &pos);
QMenu *createStandardContextMenu();
enum Extension {
};
class ExtensionOption
......
2008-06-23 Benjamin C Meyer <ben@meyerhome.net>
Reviewed by Simon.
Add function to retrieve the standard context menu
2008-06-20 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
Reviewed by Simon.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment