summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-07-29 11:04:20 +0200
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-08-04 09:42:01 +0000
commit2a56ec7ce4713711b55bb1dfc86a4320d943f606 (patch)
treeaa7edd2223e443384e157aaa367795aaec4e8a37 /src/webenginewidgets
parente11cd75ff506e8dcbfc990d70baeec821f1f0563 (diff)
add API to set the Accept-Language HTTP request-header field
Add methods to set the Accept-Language field in QWebEngineProfile and QQuickWebEngineProfile. Task-number: QTBUG-47412 Change-Id: Ifa376bb3551fdc1fb3d68279d734b7f7735782fc Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp22
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index b73355ac2..29010b0dd 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -355,6 +355,28 @@ void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCa
}
/*!
+ Sets the value of the Accept-Language HTTP request-header field.
+
+ \since 5.6
+ */
+void QWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
+{
+ Q_D(QWebEngineProfile);
+ d->browserContext()->setHttpAcceptLanguage(httpAcceptLanguage);
+}
+
+/*!
+ Returns the value of the Accept-Language HTTP request-header field.
+
+ \since 5.6
+ */
+QString QWebEngineProfile::httpAcceptLanguage() const
+{
+ Q_D(const QWebEngineProfile);
+ return d->browserContext()->httpAcceptLanguage();
+}
+
+/*!
Returns the current policy for persistent cookies.
If the profile is off-the-record NoPersistentCookies is returned.
diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h
index c90ea01e5..09160fecb 100644
--- a/src/webenginewidgets/api/qwebengineprofile.h
+++ b/src/webenginewidgets/api/qwebengineprofile.h
@@ -89,6 +89,9 @@ public:
HttpCacheType httpCacheType() const;
void setHttpCacheType(QWebEngineProfile::HttpCacheType);
+ void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
+ QString httpAcceptLanguage() const;
+
PersistentCookiesPolicy persistentCookiesPolicy() const;
void setPersistentCookiesPolicy(QWebEngineProfile::PersistentCookiesPolicy);