diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-08-21 11:30:06 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-23 16:28:24 +0000 |
commit | 3316446cfeb60a10ff5da0c7efd80515034fd9e9 (patch) | |
tree | c110e956e1ae07e39ca35a2a23ee3729a92d15a6 /src/core | |
parent | 32aaabf6075cd46249de0e3d4c8f038a9ac46fbc (diff) |
WebContentsAdapter: Fix build against Qt 5.9
QTimer::singleShot wants to copy the lambda but LoadURLParams is not copyable.
Change-Id: I300b70eef0041294080a15166a50321bb4292cfd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index c7c20c23e..5625695fc 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -638,18 +638,19 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request) } } - auto navigate = [this, loadParams = std::move(params)]() { - webContents()->GetController().LoadURLWithParams(loadParams); + auto navigate = [](WebContentsAdapter *adapter, const content::NavigationController::LoadURLParams ¶ms) { + adapter->webContents()->GetController().LoadURLWithParams(params); // Follow chrome::Navigate and invalidate the URL immediately. - m_webContentsDelegate->NavigationStateChanged(webContents(), content::INVALIDATE_TYPE_URL); - focusIfNecessary(); + adapter->m_webContentsDelegate->NavigationStateChanged(adapter->webContents(), content::INVALIDATE_TYPE_URL); + adapter->focusIfNecessary(); }; if (resizeNeeded) { // Schedule navigation on the event loop. - QTimer::singleShot(0, std::move(navigate)); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, base::BindOnce(navigate, this, std::move(params))); } else { - navigate(); + navigate(this, params); } } |