From f8e4d61fc392bd8909835f296bdea811bfee62b4 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 5 Feb 2020 14:36:19 +0100 Subject: [PATCH] TextEditor: Handle TextEditorActionHandler ownership ... in TextEditorFactory explicitly. Plan is to remove the QObject inheritance of the factory, so it can't serve as a parent anymore. Change-Id: I7bad358b5d150c695befc7ad4afcf7c2be7fd248 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index e4cd12d1a3b..9909ef8d508 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8528,6 +8528,7 @@ public: CommentDefinition m_commentDefinition; QList m_hoverHandlers; // owned CompletionAssistProvider * m_completionAssistProvider = nullptr; // owned + std::unique_ptr m_textEditorActionHandler; bool m_useGenericHighlighter = false; bool m_duplicatedSupported = true; bool m_codeFoldingSupported = false; @@ -8602,7 +8603,8 @@ void TextEditorFactory::setAutoCompleterCreator(const AutoCompleterCreator &crea void TextEditorFactory::setEditorActionHandlers(uint optionalActions) { - new TextEditorActionHandler(this, id(), id(), optionalActions); + d->m_textEditorActionHandler.reset( + new TextEditorActionHandler(nullptr, id(), id(), optionalActions)); } void TextEditorFactory::addHoverHandler(BaseHoverHandler *handler)