aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-03-15 15:42:01 +0100
committerEike Ziller <eike.ziller@qt.io>2022-03-16 07:46:11 +0000
commit5cf4510da5509d05d1d638461af6b09a72a55d7d (patch)
treef474aeb9e28bdc2c1cdc288541501a724ff075e1
parentd24f13d66d9ac2e98b08200c4e7fe9c453422906 (diff)
Fix context menu of snippet editor
The snippet editor is a TextEditorWidget, but the special context menu of that doesn't make sense in the context of the snippet settings. Get the default context menu back. Fixes: QTCREATORBUG-27176 Change-Id: I9681482f83fe32d15be0b1386e2fb26870b955e2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/texteditor/snippets/snippeteditor.cpp5
-rw-r--r--src/plugins/texteditor/snippets/snippeteditor.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/texteditor/snippets/snippeteditor.cpp b/src/plugins/texteditor/snippets/snippeteditor.cpp
index 63ca32273a..01e3757182 100644
--- a/src/plugins/texteditor/snippets/snippeteditor.cpp
+++ b/src/plugins/texteditor/snippets/snippeteditor.cpp
@@ -61,4 +61,9 @@ void SnippetEditorWidget::focusOutEvent(QFocusEvent *event)
TextEditorWidget::focusOutEvent(event);
}
+void SnippetEditorWidget::contextMenuEvent(QContextMenuEvent *e)
+{
+ QPlainTextEdit::contextMenuEvent(e);
+}
+
} // namespace
diff --git a/src/plugins/texteditor/snippets/snippeteditor.h b/src/plugins/texteditor/snippets/snippeteditor.h
index 8bb972cf68..f422c09bb5 100644
--- a/src/plugins/texteditor/snippets/snippeteditor.h
+++ b/src/plugins/texteditor/snippets/snippeteditor.h
@@ -42,6 +42,7 @@ signals:
protected:
void focusOutEvent(QFocusEvent *event) override;
+ void contextMenuEvent(QContextMenuEvent *e) override;
int extraAreaWidth(int * /* markWidthPtr */ = nullptr) const override { return 0; }
};