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 <david.schulz@qt.io>
This commit is contained in:
hjk
2020-02-05 14:36:19 +01:00
parent 80e7e70889
commit f8e4d61fc3

View File

@@ -8528,6 +8528,7 @@ public:
CommentDefinition m_commentDefinition;
QList<BaseHoverHandler *> m_hoverHandlers; // owned
CompletionAssistProvider * m_completionAssistProvider = nullptr; // owned
std::unique_ptr<TextEditorActionHandler> 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)