From 2fe08ddf9388598003cb3a30f30a2d18ab044969 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 18 Oct 2016 19:01:16 +0200 Subject: Update spellcheck api to support multiple languages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-56074 Change-Id: I2a66e91dd4ed1026e5ab2539cfd3f9094263b48c Reviewed-by: Michael BrĂ¼ning --- src/webenginewidgets/api/qwebengineprofile.cpp | 20 ++++++++++---------- src/webenginewidgets/api/qwebengineprofile.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/webenginewidgets') diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index bd41a5126..886a7207e 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -98,8 +98,8 @@ using QtWebEngineCore::BrowserContextAdapter; QWebEngineUrlSchemeHandler::requestStarted() as QWebEngineUrlRequestJob objects. Spellchecking HTML form fields can be enabled per profile by using the setSpellCheckEnabled() - method and the current language used for spellchecking can be set by using the - setSpellCheckLanguage() method. + method and the current languages used for spellchecking can be set by using the + setSpellCheckLanguages() method. */ @@ -565,9 +565,9 @@ QWebEngineProfile *QWebEngineProfile::defaultProfile() /*! \since 5.8 - Sets the current \a language for the spell checker. - The language should match the name of the \c .bdic dictionary. - For example, the \a language \c en-US will load the \c en-US.bdic + Sets the current list of \a languages for the spell checker. + Each language should match the name of the \c .bdic dictionary. + For example, the language \c en-US will load the \c en-US.bdic dictionary file. Qt WebEngine checks for the \c qtwebengine_dictionaries subdirectory @@ -603,21 +603,21 @@ QWebEngineProfile *QWebEngineProfile::defaultProfile() \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}. */ -void QWebEngineProfile::setSpellCheckLanguage(const QString &language) +void QWebEngineProfile::setSpellCheckLanguages(const QStringList &languages) { Q_D(QWebEngineProfile); - d->browserContext()->setSpellCheckLanguage(language); + d->browserContext()->setSpellCheckLanguages(languages); } /*! \since 5.8 - Returns the language used by the spell checker. + Returns the list of languages used by the spell checker. */ -QString QWebEngineProfile::spellCheckLanguage() const +QStringList QWebEngineProfile::spellCheckLanguages() const { const Q_D(QWebEngineProfile); - return d->browserContext()->spellCheckLanguage(); + return d->browserContext()->spellCheckLanguages(); } /*! diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h index 704414bcf..1ce4bfe17 100644 --- a/src/webenginewidgets/api/qwebengineprofile.h +++ b/src/webenginewidgets/api/qwebengineprofile.h @@ -121,8 +121,8 @@ public: void clearHttpCache(); - void setSpellCheckLanguage(const QString &language); - QString spellCheckLanguage() const; + void setSpellCheckLanguages(const QStringList &languages); + QStringList spellCheckLanguages() const; void setSpellCheckEnabled(bool enabled); bool isSpellCheckEnabled() const; -- cgit v1.2.3