Editor: always configured assistant

A code assistant is not usable without a text editor widget and is
always created as part of one, so make the dependency obvious by require
it in the construction of the code assistant. This removes a bunch of
functions and cheks.

Change-Id: I96556430082ff729d99d2ae2516599f9b8cbc704
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-11-10 14:38:34 +01:00
parent be3a781581
commit f297b3f1b5
3 changed files with 7 additions and 31 deletions

View File

@@ -904,6 +904,7 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent)
, m_requestMarkEnabled(true)
, m_lineSeparatorsAllowed(false)
, m_maybeFakeTooltipEvent(false)
, m_codeAssistant(parent)
, m_hoverHandlerRunner(parent, m_hoverHandlers)
, m_clipboardAssistProvider(new ClipboardAssistProvider)
, m_autoCompleter(new AutoCompleter)
@@ -8876,7 +8877,6 @@ BaseTextEditor *TextEditorFactoryPrivate::createEditorHelper(const TextDocumentP
textEditorWidget->autoCompleter()->setTabSettings(document->tabSettings());
textEditorWidget->d->m_hoverHandlers = m_hoverHandlers;
textEditorWidget->d->m_codeAssistant.configure(textEditorWidget);
textEditorWidget->d->m_commentDefinition = m_commentDefinition;
QObject::connect(textEditorWidget,