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/webengine/api/qquickwebengineprofile.cpp | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/webengine/api/qquickwebengineprofile.cpp') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 6a4846ddf..871428f33 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -87,8 +87,8 @@ ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineC register custom URL schemes (QQuickWebEngineProfile::installUrlSchemeHandler). Spellchecking HTML form fields can be enabled per profile by setting the \l spellCheckEnabled - property and the current language used for spellchecking can be set by using the - \l spellCheckLanguage property. + property and the current languages used for spellchecking can be set by using the + \l spellCheckLanguages property. */ /*! @@ -618,18 +618,18 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() } /*! - \property QQuickWebEngineProfile::spellCheckLanguage - \brief the language used by the spell checker. + \property QQuickWebEngineProfile::spellCheckLanguages + \brief The languages used by the spell checker. \since QtWebEngine 1.4 */ /*! - \qmlproperty QString WebEngineProfile::spellCheckLanguage + \qmlproperty list WebEngineProfile::spellCheckLanguages - This property holds the language used by 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 + This property holds the list of languages used by 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 @@ -666,24 +666,24 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() \since QtWebEngine 1.4 */ -void QQuickWebEngineProfile::setSpellCheckLanguage(const QString &language) +void QQuickWebEngineProfile::setSpellCheckLanguages(const QStringList &languages) { Q_D(QQuickWebEngineProfile); - if (language != d->browserContext()->spellCheckLanguage()) { - d->browserContext()->setSpellCheckLanguage(language); - emit spellCheckLanguageChanged(); + if (languages != d->browserContext()->spellCheckLanguages()) { + d->browserContext()->setSpellCheckLanguages(languages); + emit spellCheckLanguagesChanged(); } } /*! \since 5.8 - Returns the language used by the spell checker. + Returns the list of languages used by the spell checker. */ -QString QQuickWebEngineProfile::spellCheckLanguage() const +QStringList QQuickWebEngineProfile::spellCheckLanguages() const { const Q_D(QQuickWebEngineProfile); - return d->browserContext()->spellCheckLanguage(); + return d->browserContext()->spellCheckLanguages(); } /*! @@ -694,7 +694,7 @@ QString QQuickWebEngineProfile::spellCheckLanguage() const */ /*! - \qmlproperty QString WebEngineProfile::spellCheckEnabled + \qmlproperty bool WebEngineProfile::spellCheckEnabled This property holds whether the web engine spell checker is enabled. -- cgit v1.2.3