diff options
Diffstat (limited to 'src/webengine/api/qquickwebenginecontextmenudata.cpp')
-rw-r--r-- | src/webengine/api/qquickwebenginecontextmenudata.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginecontextmenudata.cpp b/src/webengine/api/qquickwebenginecontextmenudata.cpp index 684903ec0..16cb4ff69 100644 --- a/src/webengine/api/qquickwebenginecontextmenudata.cpp +++ b/src/webengine/api/qquickwebenginecontextmenudata.cpp @@ -170,6 +170,34 @@ bool QQuickWebEngineContextMenuData::isContentEditable() const return d ? d->isEditable : false; } +/*! + \qmlproperty QString WebEngineContextMenuData::misspelledWord + + If the context is a word considered misspelled by the spell-checker, returns the misspelled word. + + \since QtWebEngine 1.4 +*/ +QString QQuickWebEngineContextMenuData::misspelledWord() const +{ + if (d) + return d->misspelledWord; + return QString(); +} + +/*! + \qmlproperty QStringList WebEngineContextMenuData::spellCheckerSuggestions + + If the context is a word considered misspelled by the spell-checker, returns a list of suggested replacements. + + \since QtWebEngine 1.4 +*/ +QStringList QQuickWebEngineContextMenuData::spellCheckerSuggestions() const +{ + if (d) + return d->spellCheckerSuggestions; + return QStringList(); +} + void QQuickWebEngineContextMenuData::update(const QtWebEngineCore::WebEngineContextMenuData &update) { const QQuickWebEngineContextMenuData old(d); @@ -198,6 +226,12 @@ void QQuickWebEngineContextMenuData::update(const QtWebEngineCore::WebEngineCont if (isContentEditable() != old.isContentEditable()) Q_EMIT isContentEditableChanged(); + + if (misspelledWord() != old.misspelledWord()) + Q_EMIT misspelledWordChanged(); + + if (spellCheckerSuggestions() != old.spellCheckerSuggestions()) + Q_EMIT spellCheckerSuggestionsChanged(); } QQuickWebEngineContextMenuData::QQuickWebEngineContextMenuData(const QQuickWebEngineContextMenuDataPrivate *p, QObject *parent) |