diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2016-09-09 17:09:42 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2016-10-17 16:38:34 +0000 |
commit | 7b7c9cb4183651b496501e89deb497490199b320 (patch) | |
tree | 8f75ba32ab826cfd5c1d689c24ca88f20520c50f /examples/webenginewidgets/spellchecker/spellchecker.pro | |
parent | 1eb814230515ffb3417e0ac9533fc24847c1ebb9 (diff) |
Fix spellchecking for macOS
The change fixes spellchecking to work on macOS.
A new WebEngine configure option is available to allow spellchecking on
macOS to use either Hunspell like the other platforms, or the native
spellchecker that comes with the OS. The default is to use Hunspell.
Task-number: QTBUG-53135
Change-Id: I3e45b2e0d728b1bf2659c35f3d0a042b0ecd6239
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'examples/webenginewidgets/spellchecker/spellchecker.pro')
-rw-r--r-- | examples/webenginewidgets/spellchecker/spellchecker.pro | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/webenginewidgets/spellchecker/spellchecker.pro b/examples/webenginewidgets/spellchecker/spellchecker.pro index c7bee6584..c6031a36d 100644 --- a/examples/webenginewidgets/spellchecker/spellchecker.pro +++ b/examples/webenginewidgets/spellchecker/spellchecker.pro @@ -3,6 +3,10 @@ TARGET = spellchecker QT += webenginewidgets CONFIG += c++11 +contains(WEBENGINE_CONFIG, use_native_spellchecker) { + error("Spellcheck example can not be built when using native OS dictionaries.") +} + HEADERS += \ webview.h @@ -33,7 +37,11 @@ debug_and_release { DICTIONARIES_DIR = qtwebengine_dictionaries } -dict.files = $$PWD/dict/en/en-US.dic $$PWD/dict/de/de-DE.dic +dict_base_paths = en/en-US de/de-DE +for (base_path, dict_base_paths) { + dict.files += $$PWD/dict/$${base_path}.dic +} + dictoolbuild.input = dict.files dictoolbuild.output = $${DICTIONARIES_DIR}/${QMAKE_FILE_BASE}.bdic dictoolbuild.depends = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.aff @@ -41,3 +49,15 @@ dictoolbuild.commands = $${CONVERT_TOOL} ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} dictoolbuild.name = Build ${QMAKE_FILE_IN_BASE} dictoolbuild.CONFIG = no_link target_predeps QMAKE_EXTRA_COMPILERS += dictoolbuild + +# When the example is compiled as a bundle, WebEngine expects to find the dictionaries in +# bundle.app/Contents/Resources/qtwebengine_dictionaries +macos:app_bundle { + for (base_path, dict_base_paths) { + base_path_splitted = $$split(base_path, /) + base_name = $$last(base_path_splitted) + binary_dict_files.files += $${DICTIONARIES_DIR}/$${base_name}.bdic + } + binary_dict_files.path = Contents/Resources/$$DICTIONARIES_DIR + QMAKE_BUNDLE_DATA += binary_dict_files +} |