summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@qt.io>2016-09-09 13:19:45 +0200
committerLeena Miettinen <riitta-leena.miettinen@qt.io>2016-09-20 07:53:16 +0000
commit37d03fb2dbeb1dcc4793bc735abb742ef481dd3e (patch)
tree01fd4eb32f9ff5073b73c665f0dae835402b5641
parent6106d6b0b3833e63aeb568f37a47fc6adca8fdb9 (diff)
Doc: Describe spellchecking feature in overviews
Change-Id: I1164a505752d37a31006175dd6a3e6555b973e20 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp4
-rw-r--r--src/webengine/doc/src/qtwebengine-features.qdoc43
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp5
3 files changed, 52 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index 6633ee23b..32161570d 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -85,6 +85,10 @@ ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineC
QQuickWebEngineProfile class, which exposes further functionality in C++. This allows Qt Quick
applications to intercept URL requests (QQuickWebEngineProfile::setRequestInterceptor), or
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.
*/
/*!
diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc
index d63e2f4a7..ab022711c 100644
--- a/src/webengine/doc/src/qtwebengine-features.qdoc
+++ b/src/webengine/doc/src/qtwebengine-features.qdoc
@@ -42,6 +42,7 @@
\li \l{HTML5 Geolocation}
\li \l{Pepper Plugin API}
\li \l{Print to PDF}
+ \li \l{Spellchecker}
\li \l{View Source}
\li \l{WebRTC}
\endlist
@@ -223,6 +224,48 @@
Support for this feature was added in Qt 5.7.0.
+ \section1 Spellchecker
+
+ Qt WebEngine supports integrating spellchecking support into HTML forms to
+ enable users to submit spellchecked messages. When the user clicks on
+ an underlined misspelled word, the default context menu displays up to four
+ suggestions. Selecting one will replace the misspelled word.
+
+ To be able to check the spelling, the spellchecker needs dictionaries. It
+ supports dictionaries from the \l{Hunspell project}, but they have to be
+ compiled into a special binary format. A Hunspell dictionary consists of two
+ files:
+
+ \list
+
+ \li A \c .dic file that is a dictionary containing words for the
+ language
+ \li An \c .aff file that defines the meaning of special flags in the
+ dictionary
+ \endlist
+
+ These two files can be converted into the \c bdic format by using the
+ \c qwebengine_convert_dict tool that is shipped together with Qt.
+ When the Qt WebEngine spellchecker initializes, it will try to load the
+ \c bdict dictionaries and to check them for consistency. First, it searches
+ \e qtwebengine_dictionaries directories relative to the executable,
+ then it will look in \c QT_INSTALL_PREFIX/qtwebengines_dictionaries.
+
+ Spellchecking is disabled by default and can be enabled per profile by
+ using the QWebEngineProfile::setSpellCheckEnabled() method in widget-based
+ applications and the \l {QQuickWebEngineProfile::spellCheckEnabled}
+ {WebEngineProfile.spellCheckEnabled} property in Qt Quick applications.
+
+ The current language used for spellchecking is defined per profile, and can
+ be set using the QWebEngineProfile::setSpellCheckLanguage() method or the
+ \l {QQuickWebEngineProfile::spellCheckLanguage}
+ {WebEngineProfile.spellCheckLanguage} property.
+
+ This feature can be tested by building and running the
+ \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
+
+ Support for this feature was added in Qt 5.8.0.
+
\section1 View Source
Qt WebEngine supports viewing the HTML source of a web page.
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index b35fb0cc1..a400b5792 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -96,6 +96,11 @@ using QtWebEngineCore::BrowserContextAdapter;
A QWebEngineUrlSchemeHandler can be registered for a profile by installUrlSchemeHandler()
to add support for custom URL schemes. Requests for the scheme are then issued to
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.
+
*/
/*!