+#if defined HAVE_SONNET && !defined HAVE_KDE
+Sonnet::Highlighter *MultiLineEdit::highlighter() const
+{
+ return _spellCheckDecorator->highlighter();
+}
+
+
+void MultiLineEdit::setSpellCheckEnabled(bool enabled)
+{
+ highlighter()->setActive(enabled);
+ if (enabled) {
+ highlighter()->slotRehighlight();
+ }
+}
+
+void MultiLineEdit::contextMenuEvent(QContextMenuEvent *event)
+{
+ QMenu *menu = createStandardContextMenu();
+ menu->addSeparator();
+
+ auto action = menu->addAction(tr("Auto Spell Check"));
+ action->setCheckable(true);
+ action->setChecked(highlighter()->isActive());
+ connect(action, SIGNAL(toggled(bool)), this, SLOT(setSpellCheckEnabled(bool)));
+
+ menu->exec(event->globalPos());
+ delete menu;
+}
+
+#endif
+
+