summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2017-08-01 17:18:08 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-04 05:55:43 +0000
commitf26d944dcff91da2cf4d2cfbabbb539e6a4a6e5c (patch)
tree876ca02b97fb02002f9022aaad5500d2d8e2fb3b
parentff4b006a565f2a945903a131f46d637d8b77188e (diff)
Reorder documentation for QtWebEngine dictionary discovery
This also adds documentation for QTWEBENGINE_DICTIONARY_PATH from my previous change. Change-Id: I85cd7476c095d5427e2db3a909449838a2362b81 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc11
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp30
-rw-r--r--src/webengine/doc/src/qtwebengine-features.qdoc37
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp30
4 files changed, 40 insertions, 68 deletions
diff --git a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
index b0240cd4d..b725f8317 100644
--- a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
+++ b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
@@ -75,15 +75,8 @@
about how to create \c dic and \c aff files, see the Hunspell dictionary
file format specification in the \l{Hunspell Project}.
- When a specific spellchecking language is requested, Qt WebEngine will try
- to load the already compiled matching \c .bdic file first from
- \e qtwebengine_dictionaries directories relative to the executable,
- then it will look in \c QT_INSTALL_PREFIX/qtwebengine_dictionaries.
-
- On macOS, because this example was configured to use Hunspell dictionaries, Qt WebEngine will
- look in the \e qtwebengine_dictionaries directory located inside the application bundle
- \c Resources directory, and also in the \c Resources directory located inside the
- Qt framework bundle.
+ See the \l {Spellchecker}{Spellchecker feature documentation} for how
+ dictionary files are searched.
We specify the QMAKE_EXTRA_COMPILERS parameter in the project file to add a
conversion step to the build process:
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index 74ff1c8a1..fa30a39e0 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -668,34 +668,8 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile()
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
- first in the local directory and if it is not found, in the Qt
- installation directory.
-
- On macOS, depending on how Qt WebEngine is configured at build time, there are two possibilities
- how spellchecking data is found:
-
- \list
- \li Hunspell dictionaries (default) - .bdic dictionaries are used, just like on other
- platforms
- \li Native dictionaries - the macOS spellchecking APIs are used (which means the results
- will depend on the installed OS dictionaries)
- \endlist
-
- Thus, in the macOS Hunspell case, Qt WebEngine will look in the \e qtwebengine_dictionaries
- subdirectory located inside the application bundle \c Resources directory, and also in the
- \c Resources directory located inside the Qt framework bundle.
-
- To summarize, in case of Hunspell usage, the following paths are considered:
-
- \list
- \li QCoreApplication::applicationDirPath()/qtwebengine_dictionaries
- or QCoreApplication::applicationDirPath()/../Contents/Resources/qtwebengine_dictionaries
- (on macOS)
- \li [QLibraryInfo::DataPath]/qtwebengine_dictionaries
- or path/to/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries (Qt framework
- bundle on macOS)
- \endlist
+ See the \l {Spellchecker}{Spellchecker feature documentation} for how
+ dictionary files are searched.
For more information about how to compile \c .bdic dictionaries, see the
\l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc
index c8ff2250d..a5e972023 100644
--- a/src/webengine/doc/src/qtwebengine-features.qdoc
+++ b/src/webengine/doc/src/qtwebengine-features.qdoc
@@ -293,9 +293,40 @@
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.
+ \c bdict dictionaries and to check them for consistency.
+
+ If \c QTWEBENGINE_DICTIONARIES_PATH is set, the spellchecker uses the
+ dictionaries in the specified directory without looking anywere else.
+ Otherwise, it uses the \e qtwebengine_dictionaries directory relative to the
+ executable if it exists. If it does not exist, it will look in \c
+ QT_INSTALL_PREFIX/qtwebengines_dictionaries.
+
+ On macOS, depending on how Qt WebEngine is configured at build time, there
+ are two possibilities how spellchecking data is found:
+
+ \list
+ \li Hunspell dictionaries (default) - .bdic dictionaries are used, just
+ like on other platforms
+ \li Native dictionaries - the macOS spellchecking APIs are used (which
+ means the results will depend on the installed OS dictionaries)
+ \endlist
+
+ Thus, in the macOS Hunspell case, Qt WebEngine will look in the \e
+ qtwebengine_dictionaries subdirectory located inside the application bundle
+ \c Resources directory, and also in the \c Resources directory located
+ inside the Qt framework bundle.
+
+ To summarize, in case of Hunspell usage, the following paths are considered:
+
+ \list
+ \li \c QTWEBENGINE_DICTIONARIES_PATH, if set
+ \li QCoreApplication::applicationDirPath()/qtwebengine_dictionaries
+ or QCoreApplication::applicationDirPath()/../Contents/Resources/qtwebengine_dictionaries
+ (on macOS)
+ \li [QLibraryInfo::DataPath]/qtwebengine_dictionaries
+ or path/to/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries (Qt framework
+ bundle on macOS)
+ \endlist
Spellchecking is disabled by default and can be enabled per profile by
using the QWebEngineProfile::setSpellCheckEnabled() method in widget-based
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index f3608471c..adafc1544 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -569,34 +569,8 @@ QWebEngineProfile *QWebEngineProfile::defaultProfile()
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
- first in the local directory and if it is not found, in the Qt
- installation directory.
-
- On macOS, depending on how Qt WebEngine is configured at build time, there are two possibilities
- how spellchecking data is found:
-
- \list
- \li Hunspell dictionaries (default) - .bdic dictionaries are used, just like on other
- platforms
- \li Native dictionaries - the macOS spellchecking APIs are used (which means the results
- will depend on the installed OS dictionaries)
- \endlist
-
- Thus, in the macOS Hunspell case, Qt WebEngine will look in the \e qtwebengine_dictionaries
- subdirectory located inside the application bundle \c Resources directory, and also in the
- \c Resources directory located inside the Qt framework bundle.
-
- To summarize, in case of Hunspell usage, the following paths are considered:
-
- \list
- \li QCoreApplication::applicationDirPath()/qtwebengine_dictionaries
- or QCoreApplication::applicationDirPath()/../Contents/Resources/qtwebengine_dictionaries
- (on macOS)
- \li [QLibraryInfo::DataPath]/qtwebengine_dictionaries
- or path/to/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries (Qt framework
- bundle on macOS)
- \endlist
+ See the \l {Spellchecker}{Spellchecker feature documentation} for how
+ dictionary files are searched.
For more information about how to compile \c .bdic dictionaries, see the
\l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.