diff options
author | Ionut Alexandrescu <ionut.alexandrescu@qt.io> | 2017-01-20 14:24:35 +0100 |
---|---|---|
committer | Ionut Alexandrescu <ionut.alexandrescu@qt.io> | 2017-01-20 13:43:19 +0000 |
commit | 221f83d34a3dce9f185afe679290d600beb5b81b (patch) | |
tree | 89818e750545fa48230184556e2a58794220b817 /examples/webenginewidgets | |
parent | 9cc6592de3029da98be34a54b56bbd004e93d569 (diff) |
Fixing webengine spell checker example
The languages submenu was not working corectly,
languages could not be checked
Change-Id: I7221d3527dbd6e071eb8d1585fb6d90812c61f94
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'examples/webenginewidgets')
-rw-r--r-- | examples/webenginewidgets/spellchecker/webview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/webenginewidgets/spellchecker/webview.cpp b/examples/webenginewidgets/spellchecker/webview.cpp index 86e21ab13..0e52e7628 100644 --- a/examples/webenginewidgets/spellchecker/webview.cpp +++ b/examples/webenginewidgets/spellchecker/webview.cpp @@ -65,7 +65,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) } QWebEngineProfile *profile = page()->profile(); - const QString &language = profile->spellCheckLanguages().first(); + const QStringList &languages = profile->spellCheckLanguages(); QMenu *menu = page()->createStandardContextMenu(); menu->addSeparator(); @@ -83,7 +83,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) QAction *action = subMenu->addAction(str); action->setCheckable(true); QString lang = m_spellCheckLanguages[str]; - action->setChecked(language == lang); + action->setChecked(languages.contains(lang)); connect(action, &QAction::triggered, this, [profile, lang](){ profile->setSpellCheckLanguages(QStringList()<<lang); }); |