diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2016-05-11 13:43:45 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@theqtcompany.com> | 2016-07-02 04:33:41 +0000 |
commit | 42504596248a10eb31a5b719e0676b71f55871e4 (patch) | |
tree | e7f1008595bb417e2b92bcfbb5bf4c0eb71196bf /src/webengine/api/qquickwebengineprofile.cpp | |
parent | 1e204d3b74fbe275fb4d9fe45bbb011742f828f9 (diff) |
Add back spellchecking support
This reverts commit:
* d364c05de52f9ab39034e56cac4e0a7981dc541d
* e507f140b70f464fb970d2f94357ac588dcc4f03
Moreover it fixes shut down of keyed services,
updates versioning of and fixes spellcheck unit
test context menu request, which otherwise
fails on windows.
Change-Id: I9bfc589544cb969abd6d2d7af69531b4c5c907b7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebengineprofile.cpp')
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index b39fb02fd..e4141c575 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -614,6 +614,85 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() } /*! + \property QQuickWebEngineProfile::spellCheckLanguage + \brief the language used by the spell checker. + + \since QtWebEngine 1.4 +*/ + +/*! + \qmlproperty QString WebEngineProfile::spellCheckLanguage + + 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 + dictionary file. + + The web engine checks for the \c qtwebengine_dictionaries subdirectory + first in the local directory and if it is not found in the Qt + installation directory: + + \list + \li QCoreApplication::applicationDirPath()/qtwebengine_dictionaries + \li [QLibraryInfo::DataPath]/qtwebengine_dictionaries + \endlist + + For more information about how to compile \c .bdic dictionaries, see the + \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}. + + \since QtWebEngine 1.4 +*/ +void QQuickWebEngineProfile::setSpellCheckLanguage(const QString &language) +{ + Q_D(QQuickWebEngineProfile); + if (language != d->browserContext()->spellCheckLanguage()) { + d->browserContext()->setSpellCheckLanguage(language); + emit spellCheckLanguageChanged(); + } +} + +/*! + \since 5.8 + + Returns the language used by the spell checker. +*/ +QString QQuickWebEngineProfile::spellCheckLanguage() const +{ + const Q_D(QQuickWebEngineProfile); + return d->browserContext()->spellCheckLanguage(); +} + +/*! + \property QQuickWebEngineProfile::spellCheckEnabled + \brief whether the web engine spell checker is enabled. + + \since QtWebEngine 1.4 +*/ + +/*! + \qmlproperty QString WebEngineProfile::spellCheckEnabled + + This property holds whether the web engine spell checker is enabled. + + \since QtWebEngine 1.4 +*/ +void QQuickWebEngineProfile::setSpellCheckEnabled(bool enable) +{ + Q_D(QQuickWebEngineProfile); + if (enable != isSpellCheckEnabled()) { + d->browserContext()->setSpellCheckEnabled(enable); + emit spellCheckEnabledChanged(); + } +} + +bool QQuickWebEngineProfile::isSpellCheckEnabled() const +{ + const Q_D(QQuickWebEngineProfile); + return d->browserContext()->isSpellCheckEnabled(); +} + +/*! + Returns the cookie store for this profile. */ QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const |