QmlJSEditor Exporting AutoCompleter

One more change for the new Binding Editor

Change-Id: I17c9eb02212a29abcc4ef568e7d85cffc14c023d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Aleksei German
2019-08-08 17:15:16 +02:00
parent a81c1aab2c
commit 76cf08a886
3 changed files with 4 additions and 6 deletions

View File

@@ -34,7 +34,6 @@
#include <QTextBlock> #include <QTextBlock>
using namespace QmlJSEditor; using namespace QmlJSEditor;
using namespace Internal;
using namespace QmlJS; using namespace QmlJS;
static int blockStartState(const QTextBlock &block) static int blockStartState(const QTextBlock &block)

View File

@@ -26,11 +26,11 @@
#pragma once #pragma once
#include <texteditor/autocompleter.h> #include <texteditor/autocompleter.h>
#include <qmljseditor/qmljseditor_global.h>
namespace QmlJSEditor { namespace QmlJSEditor {
namespace Internal {
class AutoCompleter : public TextEditor::AutoCompleter class QMLJSEDITOR_EXPORT AutoCompleter : public TextEditor::AutoCompleter
{ {
public: public:
AutoCompleter(); AutoCompleter();
@@ -55,5 +55,4 @@ public:
QString insertParagraphSeparator(const QTextCursor &tc) const override; QString insertParagraphSeparator(const QTextCursor &tc) const override;
}; };
} // Internal
} // QmlJSEditor } // QmlJSEditor

View File

@@ -1041,7 +1041,7 @@ QmlJSEditorFactory::QmlJSEditorFactory()
setDocumentCreator([]() { return new QmlJSEditorDocument; }); setDocumentCreator([]() { return new QmlJSEditorDocument; });
setEditorWidgetCreator([]() { return new QmlJSEditorWidget; }); setEditorWidgetCreator([]() { return new QmlJSEditorWidget; });
setEditorCreator([]() { return new QmlJSEditor; }); setEditorCreator([]() { return new QmlJSEditor; });
setAutoCompleterCreator([]() { return new Internal::AutoCompleter; }); setAutoCompleterCreator([]() { return new AutoCompleter; });
setCommentDefinition(Utils::CommentDefinition::CppStyle); setCommentDefinition(Utils::CommentDefinition::CppStyle);
setParenthesesMatchingEnabled(true); setParenthesesMatchingEnabled(true);
setCodeFoldingSupported(true); setCodeFoldingSupported(true);
@@ -1059,7 +1059,7 @@ void QmlJSEditorFactory::decorateEditor(TextEditorWidget *editor)
{ {
editor->textDocument()->setSyntaxHighlighter(new QmlJSHighlighter); editor->textDocument()->setSyntaxHighlighter(new QmlJSHighlighter);
editor->textDocument()->setIndenter(new Internal::Indenter(editor->textDocument()->document())); editor->textDocument()->setIndenter(new Internal::Indenter(editor->textDocument()->document()));
editor->setAutoCompleter(new Internal::AutoCompleter); editor->setAutoCompleter(new AutoCompleter);
} }
} // namespace QmlJSEditor } // namespace QmlJSEditor