diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-02-12 11:22:41 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-03-30 12:35:46 +0000 |
commit | 6454b6b2d0f2fbb8d140fa2555af7867964748ce (patch) | |
tree | e2d209aa02aca0bbc93fd58379524acc69e8b544 /src/core/web_contents_view_qt.cpp | |
parent | 3e30c0a33e301bb993efc7a046a34c8cbc68ca58 (diff) |
Add API for context menu data
For QWebEnginePage users to be able to make custom context menu or
extend the default context menu, they need information about the
context.
This patch adds a QWebEngineContextMenuData class that contains
contextual information when a context menu is being requested.
This is also means we can finally generate a custom context-menu in
the demobrowser the same way we did in QtWebKit.
Task-number: QTBUG-51079
Change-Id: I695b8cbf648bdc7f119b0ed51ab685cf2f8de8e4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_view_qt.cpp')
-rw-r--r-- | src/core/web_contents_view_qt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index 370f1e78f..1d39d8af8 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -150,7 +150,7 @@ ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaControls, blink::WebContextMen ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanPrint, blink::WebContextMenuData::MediaCanPrint) ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanRotate, blink::WebContextMenuData::MediaCanRotate) -static WebEngineContextMenuData fromParams(const content::ContextMenuParams ¶ms) +static inline WebEngineContextMenuData fromParams(const content::ContextMenuParams ¶ms) { WebEngineContextMenuData ret; ret.pos = QPoint(params.x, params.y); @@ -162,8 +162,8 @@ static WebEngineContextMenuData fromParams(const content::ContextMenuParams &par ret.hasImageContent = params.has_image_contents; ret.mediaFlags = params.media_flags; ret.suggestedFileName = toQt(params.suggested_filename.data()); -#if defined(ENABLE_SPELLCHECK) ret.isEditable = params.is_editable; +#if defined(ENABLE_SPELLCHECK) ret.misspelledWord = toQt(params.misspelled_word); ret.spellCheckerSuggestions = fromVector(params.dictionary_suggestions); #endif |