From 221f83d34a3dce9f185afe679290d600beb5b81b Mon Sep 17 00:00:00 2001 From: Ionut Alexandrescu Date: Fri, 20 Jan 2017 14:24:35 +0100 Subject: Fixing webengine spell checker example The languages submenu was not working corectly, languages could not be checked Change-Id: I7221d3527dbd6e071eb8d1585fb6d90812c61f94 Reviewed-by: Michal Klocek --- examples/webenginewidgets/spellchecker/webview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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()<