diff options
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r-- | src/webenginewidgets/api/qwebenginehistory.cpp | 6 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 9 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage_p.h | 1 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/webenginewidgets/api/qwebenginehistory.cpp b/src/webenginewidgets/api/qwebenginehistory.cpp index d9e9b9c9f..7079bdfc7 100644 --- a/src/webenginewidgets/api/qwebenginehistory.cpp +++ b/src/webenginewidgets/api/qwebenginehistory.cpp @@ -281,15 +281,13 @@ void QWebEngineHistory::setMaximumItemCount(int count) QDataStream& operator<<(QDataStream& stream, const QWebEngineHistory& history) { - Q_UNUSED(history); - qWarning("Not implemented: %s", __func__); + history.d_func()->page->webContents()->serializeNavigationHistory(stream); return stream; } QDataStream& operator>>(QDataStream& stream, QWebEngineHistory& history) { - Q_UNUSED(history); - qWarning("Not implemented: %s", __func__); + history.d_func()->page->recreateFromSerializedHistory(stream); return stream; } diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index b6c84de6c..e9ad17cf0 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -354,6 +354,15 @@ void QWebEnginePagePrivate::_q_webActionTriggered(bool checked) } #endif // QT_NO_ACTION +void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input) +{ + QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this, WebContentsAdapterClient::SoftwareRenderingMode); + if (newWebContents) { + adapter = newWebContents.data(); + adapter->initialize(this); + } +} + QWebEnginePage::QWebEnginePage(QObject* parent) : QObject(*new QWebEnginePagePrivate, parent) { diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index a69866cbd..927519008 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -142,6 +142,7 @@ public: void _q_webActionTriggered(bool checked); WebContentsAdapter *webContents() { return adapter.data(); } + void recreateFromSerializedHistory(QDataStream &input); QExplicitlySharedDataPointer<WebContentsAdapter> adapter; QWebEngineHistory *history; |