QmlJsEditor: Work around moc-produced 'using namepace'

... for QmlJsEditor::QmlJsEditor causing ambiguities.

Change-Id: If15a0cb0410093857848b871d7f99c84b1b35826
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2024-01-16 12:44:19 +01:00
parent b63e2d39e8
commit 320a0da060
3 changed files with 39 additions and 32 deletions

View File

@@ -51,6 +51,7 @@
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/colorpreviewhoverhandler.h>
#include <texteditor/snippets/snippetprovider.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/textmark.h>
@@ -307,11 +308,6 @@ void QmlJSEditorWidget::updateOutlineIndexNow()
}
}
} // namespace QmlJSEditor
namespace QmlJSEditor {
void QmlJSEditorWidget::updateContextPane()
{
const SemanticInfo info = m_qmlJsEditorDocument->semanticInfo();
@@ -1181,11 +1177,37 @@ QmlJSEditorFactory::QmlJSEditorFactory(Utils::Id _id)
| TextEditorActionHandler::FindUsage);
}
void QmlJSEditorFactory::decorateEditor(TextEditorWidget *editor)
static void decorateEditor(TextEditorWidget *editor)
{
editor->textDocument()->resetSyntaxHighlighter([] { return new QmlJSHighlighter(); });
editor->textDocument()->setIndenter(createQmlJsIndenter(editor->textDocument()->document()));
editor->setAutoCompleter(new AutoCompleter);
}
namespace Internal {
void inspectElement()
{
if (auto widget = qobject_cast<QmlJSEditorWidget *>(EditorManager::currentEditor()->widget()))
widget->inspectElementUnderCursor();
}
void showContextPane()
{
if (auto editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
editor->showContextPane();
}
void setupQmlJSEditor()
{
static QmlJSEditorFactory theQmlJSEditorFactory;
TextEditor::SnippetProvider::registerGroup(Constants::QML_SNIPPETS_GROUP_ID,
Tr::tr("QML", "SnippetProvider"),
&decorateEditor);
}
} // namespace Internal
} // namespace QmlJSEditor