From 10c8d5f0cad6c89a75a7662aed0912c622482f03 Mon Sep 17 00:00:00 2001 From: hjk <hjk121@nokiamail.com> Date: Fri, 26 Sep 2014 11:37:54 +0200 Subject: [PATCH] TextEditor: Rename BaseTextEditorWidget to TextEditorWidget ... and some of the related implementation details Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d Reviewed-by: David Schulz <david.schulz@digia.com> --- src/libs/qmljs/qmljsicontextpane.h | 6 +- src/plugins/android/androidmanifesteditor.cpp | 2 +- src/plugins/android/androidmanifesteditor.h | 2 +- .../android/androidmanifesteditorfactory.cpp | 2 +- .../android/androidmanifesteditorwidget.cpp | 6 +- .../android/androidmanifesteditorwidget.h | 6 +- src/plugins/android/javaeditor.cpp | 2 +- src/plugins/android/javaeditor.h | 2 +- .../clangcodemodel/clangcompletion.cpp | 6 +- .../cmakeprojectmanager/cmakeeditor.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeeditor.h | 2 +- .../cppdocumentationcommenthelper.cpp | 2 +- .../cppeditor/cppdocumentationcommenthelper.h | 6 +- src/plugins/cppeditor/cppeditor.cpp | 24 +- src/plugins/cppeditor/cppeditor.h | 4 +- src/plugins/cppeditor/cppeditoroutline.cpp | 2 +- src/plugins/cppeditor/cppeditorplugin.cpp | 2 +- src/plugins/cppeditor/cppelementevaluator.cpp | 8 +- src/plugins/cppeditor/cppelementevaluator.h | 6 +- .../cppeditor/cppfollowsymbolundercursor.cpp | 4 +- .../cppeditor/cppfollowsymbolundercursor.h | 2 +- src/plugins/cppeditor/cpphoverhandler.cpp | 2 +- src/plugins/cppeditor/cpphoverhandler.h | 2 +- src/plugins/cppeditor/cppincludehierarchy.cpp | 6 +- .../cppeditor/cppincludehierarchymodel.cpp | 2 +- src/plugins/cppeditor/cpplocalrenaming.cpp | 8 +- src/plugins/cppeditor/cpplocalrenaming.h | 6 +- src/plugins/cppeditor/cpptypehierarchy.cpp | 3 +- .../cppeditor/cppuseselections_test.cpp | 2 +- .../cppeditor/cppuseselectionsupdater.cpp | 8 +- .../cppeditor/cppuseselectionsupdater.h | 6 +- .../cppvirtualfunctionproposalitem.cpp | 4 +- .../cppvirtualfunctionproposalitem.h | 8 +- .../cpptools/cppcodestylesettingspage.cpp | 2 +- src/plugins/cpptools/cppcompletion_test.cpp | 4 +- src/plugins/cpptools/cppcompletionassist.cpp | 10 +- .../cpptools/cpprefactoringchanges.cpp | 4 +- src/plugins/cpptools/cpprefactoringchanges.h | 4 +- src/plugins/debugger/cdb/cdbengine.cpp | 2 +- src/plugins/debugger/cdb/cdbengine.h | 2 +- src/plugins/debugger/debuggerengine.cpp | 2 +- src/plugins/debugger/debuggerengine.h | 4 +- .../debugger/debuggertooltipmanager.cpp | 14 +- src/plugins/debugger/debuggertooltipmanager.h | 6 +- src/plugins/debugger/disassembleragent.cpp | 4 +- src/plugins/debugger/gdb/gdbengine.cpp | 2 +- src/plugins/debugger/gdb/gdbengine.h | 2 +- src/plugins/debugger/lldb/lldbengine.cpp | 2 +- src/plugins/debugger/lldb/lldbengine.h | 2 +- src/plugins/debugger/pdb/pdbengine.cpp | 2 +- src/plugins/debugger/pdb/pdbengine.h | 2 +- src/plugins/debugger/qml/qmlcppengine.cpp | 2 +- src/plugins/debugger/qml/qmlcppengine.h | 2 +- src/plugins/debugger/qml/qmlengine.cpp | 2 +- src/plugins/debugger/qml/qmlengine.h | 4 +- .../debugger/qml/qmllivetextpreview.cpp | 12 +- src/plugins/debugger/qml/qmllivetextpreview.h | 2 +- .../debugger/qml/qmlv8debuggerclient.cpp | 8 +- src/plugins/debugger/sourceagent.cpp | 2 +- src/plugins/debugger/sourceutils.cpp | 4 +- src/plugins/debugger/sourceutils.h | 6 +- src/plugins/designer/formeditorw.cpp | 4 +- src/plugins/diffeditor/diffeditor.cpp | 20 +- src/plugins/diffeditor/diffeditor.h | 4 +- .../diffeditor/selectabletexteditorwidget.cpp | 5 +- .../diffeditor/selectabletexteditorwidget.h | 2 +- .../diffeditor/sidebysidediffeditorwidget.cpp | 6 +- src/plugins/emacskeys/emacskeysplugin.cpp | 2 +- src/plugins/emacskeys/emacskeysplugin.h | 4 +- src/plugins/fakevim/fakevim_test.cpp | 2 +- src/plugins/fakevim/fakevimplugin.cpp | 32 +- .../genericprojectfileseditor.h | 2 +- src/plugins/glsleditor/glsleditor.cpp | 6 +- src/plugins/glsleditor/glsleditor.h | 2 +- src/plugins/glsleditor/glslhoverhandler.cpp | 2 +- src/plugins/glsleditor/glslhoverhandler.h | 2 +- .../projectexplorer/editorconfiguration.cpp | 10 +- .../projectexplorer/editorconfiguration.h | 4 +- .../environmentitemswidget.cpp | 2 +- src/plugins/pythoneditor/pythoneditor.cpp | 2 +- src/plugins/pythoneditor/pythoneditor.h | 2 +- .../qmakeprojectmanager/profileeditor.cpp | 2 +- .../qmakeprojectmanager/profileeditor.h | 2 +- .../profilehoverhandler.cpp | 2 +- .../qmakeprojectmanager/profilehoverhandler.h | 2 +- .../components/integration/designdocument.cpp | 2 +- .../include/basetexteditmodifier.h | 2 +- .../model/basetexteditmodifier.cpp | 8 +- .../qmljseditor/qmljscompletionassist.cpp | 2 +- .../qmljseditor/qmljscompletionassist.h | 2 +- src/plugins/qmljseditor/qmljseditor.cpp | 22 +- src/plugins/qmljseditor/qmljseditor.h | 6 +- src/plugins/qmljseditor/qmljshoverhandler.cpp | 6 +- src/plugins/qmljseditor/qmljshoverhandler.h | 4 +- src/plugins/qmljseditor/quicktoolbar.cpp | 4 +- src/plugins/qmljseditor/quicktoolbar.h | 6 +- .../qmljstools/qmljsrefactoringchanges.cpp | 4 +- .../qmljstools/qmljsrefactoringchanges.h | 4 +- .../qnx/bardescriptoreditorfactory.cpp | 2 +- src/plugins/qnx/bardescriptoreditorwidget.cpp | 6 +- src/plugins/qnx/bardescriptoreditorwidget.h | 6 +- src/plugins/texteditor/basehoverhandler.cpp | 4 +- src/plugins/texteditor/basehoverhandler.h | 6 +- .../texteditor/circularclipboardassist.cpp | 4 +- .../codeassist/assistproposalitem.cpp | 8 +- .../codeassist/assistproposalitem.h | 10 +- .../texteditor/codeassist/codeassistant.cpp | 8 +- .../texteditor/codeassist/codeassistant.h | 4 +- .../codeassist/functionhintproposal.cpp | 2 +- .../codeassist/functionhintproposal.h | 2 +- .../texteditor/codeassist/genericproposal.cpp | 2 +- .../texteditor/codeassist/genericproposal.h | 2 +- .../texteditor/codeassist/iassistproposal.h | 4 +- .../codeassist/keywordscompletionassist.cpp | 2 +- .../codeassist/keywordscompletionassist.h | 2 +- .../texteditor/plaintexteditorfactory.cpp | 2 +- .../texteditor/plaintexteditorfactory.h | 2 +- src/plugins/texteditor/refactoringchanges.cpp | 12 +- src/plugins/texteditor/refactoringchanges.h | 12 +- src/plugins/texteditor/refactoroverlay.cpp | 2 +- src/plugins/texteditor/refactoroverlay.h | 6 +- .../texteditor/snippets/snippeteditor.cpp | 4 +- .../texteditor/snippets/snippeteditor.h | 2 +- src/plugins/texteditor/textdocument.cpp | 4 +- src/plugins/texteditor/textdocument.h | 2 +- src/plugins/texteditor/texteditor.cpp | 801 +++++++++--------- src/plugins/texteditor/texteditor.h | 40 +- src/plugins/texteditor/texteditor_p.h | 17 +- src/plugins/texteditor/texteditor_test.cpp | 8 +- .../texteditor/texteditoractionhandler.cpp | 166 ++-- .../texteditor/texteditoractionhandler.h | 4 +- src/plugins/texteditor/texteditoroverlay.cpp | 2 +- src/plugins/texteditor/texteditoroverlay.h | 6 +- src/plugins/vcsbase/basevcseditorfactory.cpp | 2 +- src/plugins/vcsbase/basevcseditorfactory.h | 2 +- src/plugins/vcsbase/vcsbaseeditor.cpp | 16 +- src/plugins/vcsbase/vcsbaseeditor.h | 2 +- 137 files changed, 825 insertions(+), 827 deletions(-) diff --git a/src/libs/qmljs/qmljsicontextpane.h b/src/libs/qmljs/qmljsicontextpane.h index 1f32cc1c122..2ede43c682f 100644 --- a/src/libs/qmljs/qmljsicontextpane.h +++ b/src/libs/qmljs/qmljsicontextpane.h @@ -37,7 +37,7 @@ #include <qmljs/qmljsdocument.h> #include <qmljs/parser/qmljsastfwd_p.h> -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace QmlJS { @@ -50,9 +50,9 @@ class QMLJS_EXPORT IContextPane : public QObject public: IContextPane(QObject *parent = 0) : QObject(parent) {} virtual ~IContextPane() {} - virtual void apply(TextEditor::BaseTextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force = false) = 0; + virtual void apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force = false) = 0; virtual void setEnabled(bool) = 0; - virtual bool isAvailable(TextEditor::BaseTextEditorWidget *editorWidget, Document::Ptr document, AST::Node *node) = 0; + virtual bool isAvailable(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, AST::Node *node) = 0; virtual QWidget* widget() = 0; signals: void closed(); diff --git a/src/plugins/android/androidmanifesteditor.cpp b/src/plugins/android/androidmanifesteditor.cpp index a3f6f7ad54a..e6c758ec5f3 100644 --- a/src/plugins/android/androidmanifesteditor.cpp +++ b/src/plugins/android/androidmanifesteditor.cpp @@ -84,7 +84,7 @@ Core::IDocument *AndroidManifestEditor::document() return textEditor()->textDocument(); } -TextEditor::BaseTextEditorWidget *AndroidManifestEditor::textEditor() const +TextEditor::TextEditorWidget *AndroidManifestEditor::textEditor() const { return widget()->textEditorWidget(); } diff --git a/src/plugins/android/androidmanifesteditor.h b/src/plugins/android/androidmanifesteditor.h index ee017264c89..601f2bcbab5 100644 --- a/src/plugins/android/androidmanifesteditor.h +++ b/src/plugins/android/androidmanifesteditor.h @@ -54,7 +54,7 @@ public: QWidget *toolBar(); AndroidManifestEditorWidget *widget() const; Core::IDocument *document(); - TextEditor::BaseTextEditorWidget *textEditor() const; + TextEditor::TextEditorWidget *textEditor() const; int currentLine() const; int currentColumn() const; diff --git a/src/plugins/android/androidmanifesteditorfactory.cpp b/src/plugins/android/androidmanifesteditorfactory.cpp index 4078dec5ccc..922e048def1 100644 --- a/src/plugins/android/androidmanifesteditorfactory.cpp +++ b/src/plugins/android/androidmanifesteditorfactory.cpp @@ -46,7 +46,7 @@ public: : TextEditorActionHandler(parent, Constants::ANDROID_MANIFEST_EDITOR_CONTEXT) {} private: - TextEditor::BaseTextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const + TextEditor::TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const { AndroidManifestEditor *androidManifestEditor = static_cast<AndroidManifestEditor *>(editor); return androidManifestEditor->textEditor(); diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index b31529c6f6d..ceb5e67266b 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -623,7 +623,7 @@ Core::IEditor *AndroidManifestEditorWidget::editor() const return m_editor; } -TextEditor::BaseTextEditorWidget *AndroidManifestEditorWidget::textEditorWidget() const +TextEditor::TextEditorWidget *AndroidManifestEditorWidget::textEditorWidget() const { return m_textEditorWidget; } @@ -1425,9 +1425,9 @@ int PermissionsModel::rowCount(const QModelIndex &parent) const AndroidManifestTextEditorWidget::AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent) - : TextEditor::BaseTextEditorWidget(parent) + : TextEditor::TextEditorWidget(parent) { - setTextDocument(TextEditor::BaseTextDocumentPtr(new AndroidManifestDocument(parent))); + setTextDocument(TextEditor::TextDocumentPtr(new AndroidManifestDocument(parent))); setupAsPlainEditor(); textDocument()->setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE)); } diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h index 30dc7480e62..1c2c8fcf9a3 100644 --- a/src/plugins/android/androidmanifesteditorwidget.h +++ b/src/plugins/android/androidmanifesteditorwidget.h @@ -79,7 +79,7 @@ private: QStringList m_permissions; }; -class AndroidManifestTextEditorWidget : public TextEditor::BaseTextEditorWidget +class AndroidManifestTextEditorWidget : public TextEditor::TextEditorWidget { public: explicit AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent); @@ -106,7 +106,7 @@ public: void preSave(); Core::IEditor *editor() const; - TextEditor::BaseTextEditorWidget *textEditorWidget() const; + TextEditor::TextEditorWidget *textEditorWidget() const; public slots: void setDirty(bool dirty = true); @@ -190,7 +190,7 @@ private: QComboBox *m_permissionsComboBox; QTimer m_timerParseCheck; - TextEditor::BaseTextEditorWidget *m_textEditorWidget; + TextEditor::TextEditorWidget *m_textEditorWidget; QStackedWidget *m_stackedWidget; AndroidManifestEditor *m_editor; }; diff --git a/src/plugins/android/javaeditor.cpp b/src/plugins/android/javaeditor.cpp index 0358660e6c7..34d5c38b6f8 100644 --- a/src/plugins/android/javaeditor.cpp +++ b/src/plugins/android/javaeditor.cpp @@ -52,7 +52,7 @@ namespace Internal { // JavaEditorWidget // -class JavaEditorWidget : public TextEditor::BaseTextEditorWidget +class JavaEditorWidget : public TextEditor::TextEditorWidget { public: JavaEditorWidget() diff --git a/src/plugins/android/javaeditor.h b/src/plugins/android/javaeditor.h index a583b9fe207..42fb565fee0 100644 --- a/src/plugins/android/javaeditor.h +++ b/src/plugins/android/javaeditor.h @@ -35,7 +35,7 @@ namespace Android { namespace Internal { -class JavaEditorFactory : public TextEditor::BaseTextEditorFactory +class JavaEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/clangcodemodel/clangcompletion.cpp b/src/plugins/clangcodemodel/clangcompletion.cpp index 840adf21184..acd91acccb5 100644 --- a/src/plugins/clangcodemodel/clangcompletion.cpp +++ b/src/plugins/clangcodemodel/clangcompletion.cpp @@ -263,7 +263,7 @@ public: {} virtual bool isCorrective() const { return m_replaceDotForArrow; } - virtual void makeCorrection(BaseTextEditorWidget *editorWidget) + virtual void makeCorrection(TextEditorWidget *editorWidget) { editorWidget->setCursorPosition(basePosition() - 1); editorWidget->replace(1, QLatin1String("->")); @@ -351,7 +351,7 @@ public: ClangAssistProposalItem() {} virtual bool prematurelyApplies(const QChar &c) const; - virtual void applyContextualContent(TextEditor::BaseTextEditorWidget *editorWidget, + virtual void applyContextualContent(TextEditor::TextEditorWidget *editorWidget, int basePosition) const; void keepCompletionOperator(unsigned compOp) { m_completionOperator = compOp; } @@ -410,7 +410,7 @@ bool ClangAssistProposalItem::prematurelyApplies(const QChar &typedChar) const return ok; } -void ClangAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, +void ClangAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const { const CodeCompletionResult ccr = originalItem(); diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 241624c8057..9776cc59f6c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -140,7 +140,7 @@ QString CMakeEditor::contextHelpId() const // CMakeEditorWidget // -class CMakeEditorWidget : public BaseTextEditorWidget +class CMakeEditorWidget : public TextEditorWidget { public: CMakeEditorWidget(); diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h index 954a093d7ae..eece2cfd430 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.h +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h @@ -51,7 +51,7 @@ public: friend class CMakeEditorWidget; }; -class CMakeEditorFactory : public TextEditor::BaseTextEditorFactory +class CMakeEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp b/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp index d3f8e84f551..b4429dc5708 100644 --- a/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp +++ b/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp @@ -236,7 +236,7 @@ namespace CppEditor { namespace Internal { CppDocumentationCommentHelper::CppDocumentationCommentHelper( - TextEditor::BaseTextEditorWidget *editorWidget) + TextEditor::TextEditorWidget *editorWidget) : m_editorWidget(editorWidget) , m_settings(CppToolsSettings::instance()->commentsSettings()) { diff --git a/src/plugins/cppeditor/cppdocumentationcommenthelper.h b/src/plugins/cppeditor/cppdocumentationcommenthelper.h index c8b81a3e03f..7dbdbe2a8c0 100644 --- a/src/plugins/cppeditor/cppdocumentationcommenthelper.h +++ b/src/plugins/cppeditor/cppdocumentationcommenthelper.h @@ -36,7 +36,7 @@ QT_FORWARD_DECLARE_CLASS(QKeyEvent) -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace CppEditor { namespace Internal { @@ -47,7 +47,7 @@ class CppDocumentationCommentHelper : public QObject Q_DISABLE_COPY(CppDocumentationCommentHelper) public: - explicit CppDocumentationCommentHelper(TextEditor::BaseTextEditorWidget *editorWidget); + explicit CppDocumentationCommentHelper(TextEditor::TextEditorWidget *editorWidget); bool handleKeyPressEvent(QKeyEvent *e) const; private slots: @@ -56,7 +56,7 @@ private slots: private: CppDocumentationCommentHelper(); - TextEditor::BaseTextEditorWidget *m_editorWidget; + TextEditor::TextEditorWidget *m_editorWidget; CppTools::CommentsSettings m_settings; }; diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 1cd293259b5..4f7b2694ab3 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -219,11 +219,11 @@ void CppEditorWidget::finalizeInitialization() connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updatePreprocessorButtonTooltip())); updatePreprocessorButtonTooltip(); connect(d->m_preprocessorButton, SIGNAL(clicked()), this, SLOT(showPreProcessorWidget())); - insertExtraToolBarWidget(BaseTextEditorWidget::Left, d->m_preprocessorButton); - insertExtraToolBarWidget(BaseTextEditorWidget::Left, d->m_cppEditorOutline->widget()); + insertExtraToolBarWidget(TextEditorWidget::Left, d->m_preprocessorButton); + insertExtraToolBarWidget(TextEditorWidget::Left, d->m_cppEditorOutline->widget()); } -void CppEditorWidget::finalizeInitializationAfterDuplication(BaseTextEditorWidget *other) +void CppEditorWidget::finalizeInitializationAfterDuplication(TextEditorWidget *other) { QTC_ASSERT(other, return); CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget *>(other); @@ -256,7 +256,7 @@ void CppEditorWidget::paste() if (d->m_localRenaming.handlePaste()) return; - BaseTextEditorWidget::paste(); + TextEditorWidget::paste(); } void CppEditorWidget::cut() @@ -264,7 +264,7 @@ void CppEditorWidget::cut() if (d->m_localRenaming.handleCut()) return; - BaseTextEditorWidget::cut(); + TextEditorWidget::cut(); } void CppEditorWidget::selectAll() @@ -272,7 +272,7 @@ void CppEditorWidget::selectAll() if (d->m_localRenaming.handleSelectAll()) return; - BaseTextEditorWidget::selectAll(); + TextEditorWidget::selectAll(); } void CppEditorWidget::onCppDocumentUpdated() @@ -285,7 +285,7 @@ void CppEditorWidget::onCodeWarningsUpdated(unsigned revision, { if (revision != documentRevision()) return; - setExtraSelections(BaseTextEditorWidget::CodeWarningsSelection, selections); + setExtraSelections(TextEditorWidget::CodeWarningsSelection, selections); } void CppEditorWidget::onIfdefedOutBlocksUpdated(unsigned revision, @@ -469,7 +469,7 @@ bool CppEditorWidget::event(QEvent *e) break; } - return BaseTextEditorWidget::event(e); + return TextEditorWidget::event(e); } void CppEditorWidget::performQuickFix(int index) @@ -479,7 +479,7 @@ void CppEditorWidget::performQuickFix(int index) void CppEditorWidget::processKeyNormally(QKeyEvent *e) { - BaseTextEditorWidget::keyPressEvent(e); + TextEditorWidget::keyPressEvent(e); } void CppEditorWidget::contextMenuEvent(QContextMenuEvent *e) @@ -541,13 +541,13 @@ void CppEditorWidget::keyPressEvent(QKeyEvent *e) if (d->m_cppDocumentationCommentHelper.handleKeyPressEvent(e)) return; - BaseTextEditorWidget::keyPressEvent(e); + TextEditorWidget::keyPressEvent(e); } void CppEditorWidget::applyFontSettings() { // This also makes the document apply font settings - BaseTextEditorWidget::applyFontSettings(); + TextEditorWidget::applyFontSettings(); } void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &) @@ -610,7 +610,7 @@ AssistInterface *CppEditorWidget::createAssistInterface(AssistKind kind, AssistR if (isSemanticInfoValid()) return new CppQuickFixAssistInterface(const_cast<CppEditorWidget *>(this), reason); } else { - return BaseTextEditorWidget::createAssistInterface(kind, reason); + return TextEditorWidget::createAssistInterface(kind, reason); } return 0; } diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index e599312b02b..644b7cfa834 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -57,7 +57,7 @@ public: CppEditor(); }; -class CppEditorWidget : public TextEditor::BaseTextEditorWidget +class CppEditorWidget : public TextEditor::TextEditorWidget { Q_OBJECT @@ -135,7 +135,7 @@ private slots: private: void finalizeInitialization() Q_DECL_OVERRIDE; - void finalizeInitializationAfterDuplication(BaseTextEditorWidget *other) Q_DECL_OVERRIDE; + void finalizeInitializationAfterDuplication(TextEditorWidget *other) Q_DECL_OVERRIDE; unsigned documentRevision() const; diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp index 52ff50b8296..1a680f088af 100644 --- a/src/plugins/cppeditor/cppeditoroutline.cpp +++ b/src/plugins/cppeditor/cppeditoroutline.cpp @@ -252,7 +252,7 @@ void CppEditorOutline::gotoSymbolInEditor() if (!symbol) return; - const TextEditor::BaseTextEditorWidget::Link &link = CppEditorWidget::linkToSymbol(symbol); + const TextEditor::TextEditorWidget::Link &link = CppEditorWidget::linkToSymbol(symbol); if (!link.hasValidTarget()) return; diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 6b4e5caf310..55d8197463b 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -75,7 +75,7 @@ enum { QUICKFIX_INTERVAL = 20 }; //////////////////////////// CppEditorFactory ///////////////////////////// -class CppEditorFactory : public BaseTextEditorFactory +class CppEditorFactory : public TextEditorFactory { public: CppEditorFactory() diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp index 859fb5aa5b5..7ed0900edbc 100644 --- a/src/plugins/cppeditor/cppelementevaluator.cpp +++ b/src/plugins/cppeditor/cppelementevaluator.cpp @@ -61,7 +61,7 @@ static QStringList stripName(const QString &name) return all; } -CppElementEvaluator::CppElementEvaluator(TextEditor::BaseTextEditorWidget *editor) : +CppElementEvaluator::CppElementEvaluator(TextEditor::TextEditorWidget *editor) : m_editor(editor), m_modelManager(CppTools::CppModelManager::instance()), m_tc(editor->textCursor()), @@ -122,7 +122,7 @@ void CppElementEvaluator::execute() void CppElementEvaluator::checkDiagnosticMessage(int pos) { foreach (const QTextEdit::ExtraSelection &sel, - m_editor->extraSelections(TextEditor::BaseTextEditorWidget::CodeWarningsSelection)) { + m_editor->extraSelections(TextEditor::TextEditorWidget::CodeWarningsSelection)) { if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) { m_diagnosis = sel.format.toolTip(); break; @@ -264,7 +264,7 @@ CppInclude::CppInclude(const Document::Include &includeFile) : helpCategory = TextEditor::HelpItem::Brief; helpIdCandidates = QStringList(fileName); helpMark = fileName; - link = TextEditor::BaseTextEditorWidget::Link(path); + link = TextEditor::TextEditorWidget::Link(path); tooltip = path; } @@ -275,7 +275,7 @@ CppMacro::CppMacro(const Macro ¯o) const QString macroName = QString::fromUtf8(macro.name(), macro.name().size()); helpIdCandidates = QStringList(macroName); helpMark = macroName; - link = TextEditor::BaseTextEditorWidget::Link(macro.fileName(), macro.line()); + link = TextEditor::TextEditorWidget::Link(macro.fileName(), macro.line()); tooltip = macro.toStringWithLineBreaks(); } diff --git a/src/plugins/cppeditor/cppelementevaluator.h b/src/plugins/cppeditor/cppelementevaluator.h index 7bf41fdced1..0142ba7e661 100644 --- a/src/plugins/cppeditor/cppelementevaluator.h +++ b/src/plugins/cppeditor/cppelementevaluator.h @@ -56,7 +56,7 @@ class CppElement; class CppElementEvaluator { public: - explicit CppElementEvaluator(TextEditor::BaseTextEditorWidget *editor); + explicit CppElementEvaluator(TextEditor::TextEditorWidget *editor); void setTextCursor(const QTextCursor &tc); void setLookupBaseClasses(const bool lookup); @@ -78,7 +78,7 @@ private: const CPlusPlus::LookupContext &lookupContext, const CPlusPlus::Scope *scope); - TextEditor::BaseTextEditorWidget *m_editor; + TextEditor::TextEditorWidget *m_editor; CppTools::CppModelManager *m_modelManager; QTextCursor m_tc; bool m_lookupBaseClasses; @@ -99,7 +99,7 @@ public: TextEditor::HelpItem::Category helpCategory; QStringList helpIdCandidates; QString helpMark; - TextEditor::BaseTextEditorWidget::Link link; + TextEditor::TextEditorWidget::Link link; QString tooltip; }; diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp index abe3e94d30f..cda664c41e5 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp @@ -54,7 +54,7 @@ using namespace CppEditor; using namespace CppEditor::Internal; using namespace TextEditor; -typedef BaseTextEditorWidget::Link Link; +typedef TextEditorWidget::Link Link; namespace { @@ -424,7 +424,7 @@ static int skipMatchingParentheses(const QList<Token> &tokens, int idx, int init return j; } -BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &cursor, +TextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &cursor, bool resolveTarget, const Snapshot &theSnapshot, const Document::Ptr &documentFromSemanticInfo, SymbolFinder *symbolFinder, bool inNextSplit) { diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.h b/src/plugins/cppeditor/cppfollowsymbolundercursor.h index dc08f4c321d..25a0de1dfaa 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.h +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.h @@ -49,7 +49,7 @@ class VirtualFunctionAssistProvider; class FollowSymbolUnderCursor { public: - typedef TextEditor::BaseTextEditorWidget::Link Link; + typedef TextEditor::TextEditorWidget::Link Link; FollowSymbolUnderCursor(CppEditorWidget *widget); ~FollowSymbolUnderCursor(); diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index 0fc0eaeef06..c91b7379563 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -57,7 +57,7 @@ bool CppHoverHandler::acceptEditor(IEditor *editor) return editor->document()->id() == CppEditor::Constants::CPPEDITOR_ID; } -void CppHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int pos) +void CppHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos) { if (!editorWidget->extraSelectionTooltip(pos).isEmpty()) { setToolTip(editorWidget->extraSelectionTooltip(pos)); diff --git a/src/plugins/cppeditor/cpphoverhandler.h b/src/plugins/cppeditor/cpphoverhandler.h index ed7d842975e..dea4304db73 100644 --- a/src/plugins/cppeditor/cpphoverhandler.h +++ b/src/plugins/cppeditor/cpphoverhandler.h @@ -43,7 +43,7 @@ public: private: virtual bool acceptEditor(Core::IEditor *editor); - virtual void identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos); + virtual void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos); virtual void decorateToolTip(); }; diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index a67b5c4ab06..b494a22e04c 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -50,8 +50,7 @@ #include <QStandardItem> #include <QVBoxLayout> -using namespace CppEditor; -using namespace CppEditor::Internal; +using namespace TextEditor; using namespace Utils; namespace CppEditor { @@ -163,8 +162,7 @@ void CppIncludeHierarchyWidget::perform() void CppIncludeHierarchyWidget::onItemActivated(const QModelIndex &index) { - const TextEditor::BaseTextEditorWidget::Link link - = index.data(LinkRole).value<TextEditor::BaseTextEditorWidget::Link>(); + const TextEditorWidget::Link link = index.data(LinkRole).value<TextEditorWidget::Link>(); if (link.hasValidTarget()) Core::EditorManager::openEditorAt(link.targetFileName, link.targetLine, diff --git a/src/plugins/cppeditor/cppincludehierarchymodel.cpp b/src/plugins/cppeditor/cppincludehierarchymodel.cpp index 5e415f86a59..b50df183db8 100644 --- a/src/plugins/cppeditor/cppincludehierarchymodel.cpp +++ b/src/plugins/cppeditor/cppincludehierarchymodel.cpp @@ -149,7 +149,7 @@ QVariant CppIncludeHierarchyModel::data(const QModelIndex &index, int role) cons return Core::FileIconProvider::icon(QFileInfo(item->filePath())); case LinkRole: { QVariant itemLink; - TextEditor::BaseTextEditorWidget::Link link(item->filePath(), item->line()); + TextEditor::TextEditorWidget::Link link(item->filePath(), item->line()); itemLink.setValue(link); return itemLink; } diff --git a/src/plugins/cppeditor/cpplocalrenaming.cpp b/src/plugins/cppeditor/cpplocalrenaming.cpp index f606cb45a0f..467ccde795a 100644 --- a/src/plugins/cppeditor/cpplocalrenaming.cpp +++ b/src/plugins/cppeditor/cpplocalrenaming.cpp @@ -61,7 +61,7 @@ void modifyCursorSelection(QTextCursor &cursor, int position, int anchor) namespace CppEditor { namespace Internal { -CppLocalRenaming::CppLocalRenaming(TextEditor::BaseTextEditorWidget *editorWidget) +CppLocalRenaming::CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget) : m_editorWidget(editorWidget) , m_modifyingSelections(false) , m_renameSelectionChanged(false) @@ -97,7 +97,7 @@ bool CppLocalRenaming::handlePaste() return false; startRenameChange(); - m_editorWidget->BaseTextEditorWidget::paste(); + m_editorWidget->TextEditorWidget::paste(); finishRenameChange(); return true; } @@ -108,7 +108,7 @@ bool CppLocalRenaming::handleCut() return false; startRenameChange(); - m_editorWidget->BaseTextEditorWidget::paste(); + m_editorWidget->TextEditorWidget::paste(); finishRenameChange(); return true; } @@ -289,7 +289,7 @@ void CppLocalRenaming::startRenameChange() void CppLocalRenaming::updateEditorWidgetWithSelections() { - m_editorWidget->setExtraSelections(TextEditor::BaseTextEditorWidget::CodeSemanticsSelection, + m_editorWidget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection, m_selections); } diff --git a/src/plugins/cppeditor/cpplocalrenaming.h b/src/plugins/cppeditor/cpplocalrenaming.h index 72d4f2c2d4d..6eed44230e6 100644 --- a/src/plugins/cppeditor/cpplocalrenaming.h +++ b/src/plugins/cppeditor/cpplocalrenaming.h @@ -34,7 +34,7 @@ #include <QTextEdit> -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace CppEditor { namespace Internal { @@ -45,7 +45,7 @@ class CppLocalRenaming : public QObject Q_DISABLE_COPY(CppLocalRenaming) public: - explicit CppLocalRenaming(TextEditor::BaseTextEditorWidget *editorWidget); + explicit CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget); bool start(); bool isActive() const; @@ -95,7 +95,7 @@ private: QTextCharFormat textCharFormat(TextEditor::TextStyle category) const; private: - TextEditor::BaseTextEditorWidget *m_editorWidget; + TextEditor::TextEditorWidget *m_editorWidget; QList<QTextEdit::ExtraSelection> m_selections; int m_renameSelectionIndex; diff --git a/src/plugins/cppeditor/cpptypehierarchy.cpp b/src/plugins/cppeditor/cpptypehierarchy.cpp index febf7e70474..088e0b47297 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.cpp +++ b/src/plugins/cppeditor/cpptypehierarchy.cpp @@ -232,8 +232,7 @@ void CppTypeHierarchyWidget::clearTypeHierarchy() void CppTypeHierarchyWidget::onItemClicked(const QModelIndex &index) { - const TextEditor::BaseTextEditorWidget::Link link - = index.data(LinkRole).value<TextEditor::BaseTextEditorWidget::Link>(); + auto link = index.data(LinkRole).value<TextEditor::TextEditorWidget::Link>(); if (link.hasValidTarget()) Core::EditorManager::openEditorAt(link.targetFileName, link.targetLine, diff --git a/src/plugins/cppeditor/cppuseselections_test.cpp b/src/plugins/cppeditor/cppuseselections_test.cpp index e1408c3adeb..0de552061c9 100644 --- a/src/plugins/cppeditor/cppuseselections_test.cpp +++ b/src/plugins/cppeditor/cppuseselections_test.cpp @@ -123,7 +123,7 @@ SelectionList UseSelectionsTestCase::toSelectionList( QList<QTextEdit::ExtraSelection> UseSelectionsTestCase::getExtraSelections() const { return m_editorWidget->extraSelections( - TextEditor::BaseTextEditorWidget::CodeSemanticsSelection); + TextEditor::TextEditorWidget::CodeSemanticsSelection); } SelectionList UseSelectionsTestCase::waitForUseSelections(bool *hasTimedOut) const diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp index 93a42c68321..435847bfab2 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp +++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp @@ -232,7 +232,7 @@ CppEditor::Internal::UseSelectionsResult findUses(const Params p) namespace CppEditor { namespace Internal { -CppUseSelectionsUpdater::CppUseSelectionsUpdater(TextEditor::BaseTextEditorWidget *editorWidget) +CppUseSelectionsUpdater::CppUseSelectionsUpdater(TextEditor::TextEditorWidget *editorWidget) : m_editorWidget(editorWidget) , m_findUsesRevision(-1) { @@ -460,18 +460,18 @@ QTextDocument *CppUseSelectionsUpdater::textDocument() const ExtraSelections CppUseSelectionsUpdater::currentUseSelections() const { return m_editorWidget->extraSelections( - TextEditor::BaseTextEditorWidget::CodeSemanticsSelection); + TextEditor::TextEditorWidget::CodeSemanticsSelection); } void CppUseSelectionsUpdater::updateUseSelections(const ExtraSelections &selections) { - m_editorWidget->setExtraSelections(TextEditor::BaseTextEditorWidget::CodeSemanticsSelection, + m_editorWidget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection, selections); } void CppUseSelectionsUpdater::updateUnusedSelections(const ExtraSelections &selections) { - m_editorWidget->setExtraSelections(TextEditor::BaseTextEditorWidget::UnusedSymbolSelection, + m_editorWidget->setExtraSelections(TextEditor::TextEditorWidget::UnusedSymbolSelection, selections); } diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.h b/src/plugins/cppeditor/cppuseselectionsupdater.h index 2eb33e1035b..42cd480229e 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.h +++ b/src/plugins/cppeditor/cppuseselectionsupdater.h @@ -44,7 +44,7 @@ class QTextCharFormat; class QTextCursor; QT_END_NAMESPACE -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace CppEditor { namespace Internal { @@ -66,7 +66,7 @@ class CppUseSelectionsUpdater : public QObject Q_DISABLE_COPY(CppUseSelectionsUpdater) public: - explicit CppUseSelectionsUpdater(TextEditor::BaseTextEditorWidget *editorWidget); + explicit CppUseSelectionsUpdater(TextEditor::TextEditorWidget *editorWidget); enum CallType { Synchronous, Asynchronous }; @@ -105,7 +105,7 @@ private: QTextDocument *textDocument() const; private: - TextEditor::BaseTextEditorWidget *m_editorWidget; + TextEditor::TextEditorWidget *m_editorWidget; QTimer m_timer; diff --git a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp index 193cdf4d9c4..c72e7ff1ef9 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp +++ b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp @@ -34,12 +34,12 @@ using namespace CppEditor::Internal; VirtualFunctionProposalItem::VirtualFunctionProposalItem( - const TextEditor::BaseTextEditorWidget::Link &link, bool openInSplit) + const TextEditor::TextEditorWidget::Link &link, bool openInSplit) : m_link(link), m_openInSplit(openInSplit) { } -void VirtualFunctionProposalItem::apply(TextEditor::BaseTextEditorWidget *, int) const +void VirtualFunctionProposalItem::apply(TextEditor::TextEditorWidget *, int) const { if (!m_link.hasValidTarget()) return; diff --git a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h index 711656149ad..0e848712cb2 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h +++ b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h @@ -39,13 +39,13 @@ namespace Internal { class VirtualFunctionProposalItem: public TextEditor::AssistProposalItem { public: - VirtualFunctionProposalItem(const TextEditor::BaseTextEditorWidget::Link &link, + VirtualFunctionProposalItem(const TextEditor::TextEditorWidget::Link &link, bool openInSplit = true); - void apply(TextEditor::BaseTextEditorWidget * /* editorWidget */, int /* basePosition */) const; - TextEditor::BaseTextEditorWidget::Link link() const { return m_link; } // Exposed for tests + void apply(TextEditor::TextEditorWidget * /* editorWidget */, int /* basePosition */) const; + TextEditor::TextEditorWidget::Link link() const { return m_link; } // Exposed for tests private: - TextEditor::BaseTextEditorWidget::Link m_link; + TextEditor::TextEditorWidget::Link m_link; bool m_openInSplit; }; diff --git a/src/plugins/cpptools/cppcodestylesettingspage.cpp b/src/plugins/cpptools/cppcodestylesettingspage.cpp index 084e8c2d649..d9ab82ac6dd 100644 --- a/src/plugins/cpptools/cppcodestylesettingspage.cpp +++ b/src/plugins/cpptools/cppcodestylesettingspage.cpp @@ -220,7 +220,7 @@ namespace CppTools { namespace Internal { -static void applyRefactorings(QTextDocument *textDocument, TextEditor::BaseTextEditorWidget *editor, +static void applyRefactorings(QTextDocument *textDocument, TextEditor::TextEditorWidget *editor, const CppCodeStyleSettings &settings) { // Preprocess source diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 64922367aa1..199f251ea00 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -79,7 +79,7 @@ public: m_editor = EditorManager::openEditor(fileName); QVERIFY(m_editor); closeEditorAtEndOfTestCase(m_editor); - m_editorWidget = qobject_cast<TextEditor::BaseTextEditorWidget *>(m_editor->widget()); + m_editorWidget = qobject_cast<TextEditor::TextEditorWidget *>(m_editor->widget()); QVERIFY(m_editorWidget); m_textDocument = m_editorWidget->document(); @@ -149,7 +149,7 @@ private: QByteArray m_source; int m_position; Snapshot m_snapshot; - BaseTextEditorWidget *m_editorWidget; + TextEditorWidget *m_editorWidget; QTextDocument *m_textDocument; IEditor *m_editor; }; diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 59cac54c102..64409e8be60 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -90,7 +90,7 @@ public: m_isOverloaded(false) {} bool prematurelyApplies(const QChar &c) const Q_DECL_OVERRIDE; - void applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const Q_DECL_OVERRIDE; + void applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const Q_DECL_OVERRIDE; bool isOverloaded() const { return m_isOverloaded; } void markAsOverloaded() { m_isOverloaded = true; } @@ -161,7 +161,7 @@ bool CppAssistProposalItem::prematurelyApplies(const QChar &typedChar) const return false; } -static bool isDereferenced(BaseTextEditorWidget *editorWidget, int basePosition) +static bool isDereferenced(TextEditorWidget *editorWidget, int basePosition) { QTextCursor cursor = editorWidget->textCursor(); cursor.setPosition(basePosition); @@ -181,7 +181,7 @@ static bool isDereferenced(BaseTextEditorWidget *editorWidget, int basePosition) return false; } -void CppAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const +void CppAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const { Symbol *symbol = 0; @@ -439,13 +439,13 @@ public: {} bool isCorrective() const Q_DECL_OVERRIDE { return m_replaceDotForArrow; } - void makeCorrection(BaseTextEditorWidget *editorWidget) Q_DECL_OVERRIDE; + void makeCorrection(TextEditorWidget *editorWidget) Q_DECL_OVERRIDE; private: bool m_replaceDotForArrow; }; -void CppAssistProposal::makeCorrection(BaseTextEditorWidget *editorWidget) +void CppAssistProposal::makeCorrection(TextEditorWidget *editorWidget) { const int oldPosition = editorWidget->position(); editorWidget->setCursorPosition(basePosition() - 1); diff --git a/src/plugins/cpptools/cpprefactoringchanges.cpp b/src/plugins/cpptools/cpprefactoringchanges.cpp index ac6d740b792..2867cda3b0d 100644 --- a/src/plugins/cpptools/cpprefactoringchanges.cpp +++ b/src/plugins/cpptools/cpprefactoringchanges.cpp @@ -93,7 +93,7 @@ CppRefactoringChangesData *CppRefactoringChanges::data() const return static_cast<CppRefactoringChangesData *>(m_data.data()); } -CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::BaseTextEditorWidget *editor, const Document::Ptr &document) +CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::TextEditorWidget *editor, const Document::Ptr &document) { CppRefactoringFilePtr result(new CppRefactoringFile(editor)); result->setCppDocument(document); @@ -133,7 +133,7 @@ CppRefactoringFile::CppRefactoringFile(QTextDocument *document, const QString &f : RefactoringFile(document, fileName) { } -CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor) +CppRefactoringFile::CppRefactoringFile(TextEditor::TextEditorWidget *editor) : RefactoringFile(editor) { } diff --git a/src/plugins/cpptools/cpprefactoringchanges.h b/src/plugins/cpptools/cpprefactoringchanges.h index 286988929c1..72007a3108b 100644 --- a/src/plugins/cpptools/cpprefactoringchanges.h +++ b/src/plugins/cpptools/cpprefactoringchanges.h @@ -75,7 +75,7 @@ public: protected: CppRefactoringFile(const QString &fileName, const QSharedPointer<TextEditor::RefactoringChangesData> &data); CppRefactoringFile(QTextDocument *document, const QString &fileName); - CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor); + CppRefactoringFile(TextEditor::TextEditorWidget *editor); CppRefactoringChangesData *data() const; virtual void fileChanged(); @@ -90,7 +90,7 @@ class CPPTOOLS_EXPORT CppRefactoringChanges: public TextEditor::RefactoringChang public: CppRefactoringChanges(const CPlusPlus::Snapshot &snapshot); - static CppRefactoringFilePtr file(TextEditor::BaseTextEditorWidget *editor, + static CppRefactoringFilePtr file(TextEditor::TextEditorWidget *editor, const CPlusPlus::Document::Ptr &document); CppRefactoringFilePtr file(const QString &fileName) const; // safe to use from non-gui threads diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 66de1d5c50d..98873b7c12e 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -447,7 +447,7 @@ void CdbEngine::syncVerboseLog(bool verboseLog) postCommand(m_verboseLog ? QByteArray("!sym noisy") : QByteArray("!sym quiet"), 0); } -bool CdbEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, +bool CdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &contextIn) { if (debug) diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index fb86fd7afce..38f800809c5 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -76,7 +76,7 @@ public: // Factory function that returns 0 if the debug engine library cannot be found. - virtual bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, + virtual bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &ctx); virtual void setupEngine(); virtual void setupInferior(); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index db278945c68..b5ac8c739fd 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1365,7 +1365,7 @@ DebuggerRunControl *DebuggerEngine::runControl() const return d->runControl(); } -bool DebuggerEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *, +bool DebuggerEngine::setToolTipExpression(TextEditor::TextEditorWidget *, const DebuggerToolTipContext &) { return false; diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 4453886227b..fba872301c9 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -46,7 +46,7 @@ class QMessageBox; class QAbstractItemModel; QT_END_NAMESPACE -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace Core { class IOptionsPage; } namespace Debugger { @@ -144,7 +144,7 @@ public: const DebuggerStartParameters &startParameters() const; DebuggerStartParameters &startParameters(); - virtual bool setToolTipExpression(TextEditor::BaseTextEditorWidget *, + virtual bool setToolTipExpression(TextEditor::TextEditorWidget *, const Internal::DebuggerToolTipContext &); virtual void updateWatchData(const Internal::WatchData &data, diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 7c72d8df612..c1005749ec4 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -489,7 +489,7 @@ public: QList<QPointer<DebuggerToolTipWidget> > m_tooltips; bool m_debugModeActive; QPoint m_lastToolTipPoint; - BaseTextEditorWidget *m_lastToolTipEditor; + TextEditorWidget *m_lastToolTipEditor; }; static DebuggerToolTipManagerData *d = 0; @@ -532,7 +532,7 @@ public slots: } void copy(); - void positionShow(const BaseTextEditorWidget *editorWidget); + void positionShow(const TextEditorWidget *editorWidget); void pin(); public: @@ -746,7 +746,7 @@ void DebuggerToolTipWidget::copy() clipboard->setText(clipboardText, QClipboard::Clipboard); } -void DebuggerToolTipWidget::positionShow(const BaseTextEditorWidget *editorWidget) +void DebuggerToolTipWidget::positionShow(const TextEditorWidget *editorWidget) { // Figure out new position of tooltip using the text edit. // If the line changed too much, close this tip. @@ -1249,10 +1249,10 @@ void DebuggerToolTipManager::slotEditorOpened(IEditor *e) { // Move tooltip along when scrolled. if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(e)) { - BaseTextEditorWidget *widget = textEditor->editorWidget(); + TextEditorWidget *widget = textEditor->editorWidget(); connect(widget->verticalScrollBar(), &QScrollBar::valueChanged, this, &DebuggerToolTipManager::slotUpdateVisibleToolTips); - connect(widget, &BaseTextEditorWidget::tooltipOverrideRequested, + connect(widget, &TextEditorWidget::tooltipOverrideRequested, this, &DebuggerToolTipManager::slotTooltipOverrideRequested); } } @@ -1298,7 +1298,7 @@ void DebuggerToolTipManager::leavingDebugMode() } void DebuggerToolTipManager::slotTooltipOverrideRequested - (BaseTextEditorWidget *editorWidget, const QPoint &point, int pos, bool *handled) + (TextEditorWidget *editorWidget, const QPoint &point, int pos, bool *handled) { QTC_ASSERT(handled, return); QTC_ASSERT(editorWidget, return); @@ -1320,7 +1320,7 @@ void DebuggerToolTipManager::slotTooltipOverrideRequested } } -bool DebuggerToolTipManager::tryHandleToolTipOverride(BaseTextEditorWidget *editorWidget, const QPoint &point, int pos) +bool DebuggerToolTipManager::tryHandleToolTipOverride(TextEditorWidget *editorWidget, const QPoint &point, int pos) { if (!boolSetting(UseToolTipsInMainEditor)) return false; diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h index 8fcf945a0c5..124a37514f9 100644 --- a/src/plugins/debugger/debuggertooltipmanager.h +++ b/src/plugins/debugger/debuggertooltipmanager.h @@ -41,7 +41,7 @@ class QDebug; QT_END_NAMESPACE namespace Core { class IEditor; } -namespace TextEditor { class BaseTextEditor; class BaseTextEditorWidget; } +namespace TextEditor { class BaseTextEditor; class TextEditorWidget; } namespace Debugger { class DebuggerEngine; @@ -132,11 +132,11 @@ private slots: static void slotUpdateVisibleToolTips(); void slotDebuggerStateChanged(Debugger::DebuggerState); void slotEditorOpened(Core::IEditor *); - void slotTooltipOverrideRequested(TextEditor::BaseTextEditorWidget *editorWidget, + void slotTooltipOverrideRequested(TextEditor::TextEditorWidget *editorWidget, const QPoint &point, int pos, bool *handled); private: - bool tryHandleToolTipOverride(TextEditor::BaseTextEditorWidget *editorWidget, + bool tryHandleToolTipOverride(TextEditor::TextEditorWidget *editorWidget, const QPoint &point, int pos); }; diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index 029519da0ab..7b795127ff4 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -239,7 +239,7 @@ void DisassemblerAgentPrivate::configureMimeType() MimeType mtype = MimeDatabase::findByType(mimeType); if (mtype) { foreach (IEditor *editor, DocumentModel::editorsForDocument(document)) - if (BaseTextEditorWidget *widget = qobject_cast<BaseTextEditorWidget *>(editor->widget())) + if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget())) widget->configureMimeType(mtype); } else { qWarning("Assembler mimetype '%s' not found.", qPrintable(mimeType)); @@ -287,7 +287,7 @@ void DisassemblerAgent::setContentsToDocument(const DisassemblerLines &contents) Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, &titlePattern); QTC_ASSERT(editor, return); - if (BaseTextEditorWidget *widget = qobject_cast<BaseTextEditorWidget *>(editor->widget())) { + if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget())) { widget->setReadOnly(true); widget->setRequestMarkEnabled(true); } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 83cb3ae217d..78337bbf5bd 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3650,7 +3650,7 @@ void GdbEngine::resetLocation() DebuggerEngine::resetLocation(); } -bool GdbEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editor, +bool GdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editor, const DebuggerToolTipContext &context) { if (state() != InferiorStopOk || !isCppEditor(editor)) { diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 61d99163387..088e7271799 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -407,7 +407,7 @@ protected: // // Watch specific stuff // - virtual bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editor, + virtual bool setToolTipExpression(TextEditor::TextEditorWidget *editor, const DebuggerToolTipContext &); virtual void assignValueInDebugger(const WatchData *data, const QString &expr, const QVariant &value); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 771fac59b10..810b08b3b4a 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -837,7 +837,7 @@ void LldbEngine::resetLocation() DebuggerEngine::resetLocation(); } -bool LldbEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, const DebuggerToolTipContext &context) +bool LldbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &context) { if (state() != InferiorStopOk || !isCppEditor(editorWidget)) { //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED " diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h index 31dcd156ced..1f3f85eca46 100644 --- a/src/plugins/debugger/lldb/lldbengine.h +++ b/src/plugins/debugger/lldb/lldbengine.h @@ -108,7 +108,7 @@ private: void abortDebugger(); void resetLocation(); - bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, + bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &); void continueInferior(); diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index 17eb578e428..8e635c527bf 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -452,7 +452,7 @@ static WatchData m_toolTip; static QPoint m_toolTipPos; static QHash<QString, WatchData> m_toolTipCache; -bool PdbEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, +bool PdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &ctx) { if (state() != InferiorStopOk) { diff --git a/src/plugins/debugger/pdb/pdbengine.h b/src/plugins/debugger/pdb/pdbengine.h index 482dcc3b918..502ae135c32 100644 --- a/src/plugins/debugger/pdb/pdbengine.h +++ b/src/plugins/debugger/pdb/pdbengine.h @@ -75,7 +75,7 @@ private: void shutdownInferior(); void shutdownEngine(); - bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, + bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &); void continueInferior(); diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index f9ae7a9ff3f..03fa6f4b1cf 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -89,7 +89,7 @@ bool QmlCppEngine::canDisplayTooltip() const return m_cppEngine->canDisplayTooltip() || m_qmlEngine->canDisplayTooltip(); } -bool QmlCppEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, const DebuggerToolTipContext &ctx) +bool QmlCppEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &ctx) { QTC_ASSERT(editorWidget, return false); bool success = false; diff --git a/src/plugins/debugger/qml/qmlcppengine.h b/src/plugins/debugger/qml/qmlcppengine.h index ec495a3c41e..46834aa780f 100644 --- a/src/plugins/debugger/qml/qmlcppengine.h +++ b/src/plugins/debugger/qml/qmlcppengine.h @@ -46,7 +46,7 @@ public: ~QmlCppEngine(); bool canDisplayTooltip() const; - bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, + bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &); void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 93ee96fb6b5..9dfac646384 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -983,7 +983,7 @@ void QmlEngine::requestModuleSymbols(const QString &moduleName) // ////////////////////////////////////////////////////////////////////// -bool QmlEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, +bool QmlEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &ctx) { // This is processed by QML inspector, which has dependencies to diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h index ca90142676f..2e75f5dda43 100644 --- a/src/plugins/debugger/qml/qmlengine.h +++ b/src/plugins/debugger/qml/qmlengine.h @@ -88,7 +88,7 @@ public: signals: void tooltipRequested(const QPoint &mousePos, - TextEditor::BaseTextEditorWidget *editorWidget, int cursorPos); + TextEditor::TextEditorWidget *editorWidget, int cursorPos); void aboutToNotifyInferiorSetupOk(); private slots: @@ -127,7 +127,7 @@ private: void shutdownInferior(); void shutdownEngine(); - bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, + bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &); void continueInferior(); diff --git a/src/plugins/debugger/qml/qmllivetextpreview.cpp b/src/plugins/debugger/qml/qmllivetextpreview.cpp index 03341e3e583..fe0be2ac485 100644 --- a/src/plugins/debugger/qml/qmllivetextpreview.cpp +++ b/src/plugins/debugger/qml/qmllivetextpreview.cpp @@ -391,8 +391,8 @@ void QmlLiveTextPreview::associateEditor(Core::IEditor *editor) QLatin1String("QmlJSEditor::Internal::QmlJSEditorWidget"), return); - BaseTextEditorWidget *editWidget - = qobject_cast<BaseTextEditorWidget*>(editor->widget()); + TextEditorWidget *editWidget + = qobject_cast<TextEditorWidget*>(editor->widget()); QTC_ASSERT(editWidget, return); if (!m_editors.contains(editWidget)) { @@ -412,8 +412,8 @@ void QmlLiveTextPreview::unassociateEditor(Core::IEditor *oldEditor) using namespace TextEditor; if (oldEditor && oldEditor->document()->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) { - BaseTextEditorWidget *editWidget - = qobject_cast<BaseTextEditorWidget*>(oldEditor->widget()); + TextEditorWidget *editWidget + = qobject_cast<TextEditorWidget*>(oldEditor->widget()); QTC_ASSERT(editWidget, return); if (m_editors.contains(editWidget)) { @@ -712,7 +712,7 @@ void QmlLiveTextPreview::showSyncWarning( // will be shown in case the user changes and saves the file multiple times. removeOutofSyncInfo(); - foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) { + foreach (TextEditor::TextEditorWidget *editor, m_editors) { if (editor) { Core::InfoBar *infoBar = editor->textDocument()->infoBar(); Core::InfoBarEntry info(Core::Id(INFO_OUT_OF_SYNC), errorMessage); @@ -729,7 +729,7 @@ void QmlLiveTextPreview::showSyncWarning( void QmlLiveTextPreview::removeOutofSyncInfo() { - foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) { + foreach (TextEditor::TextEditorWidget *editor, m_editors) { if (editor) { Core::InfoBar *infoBar = editor->textDocument()->infoBar(); infoBar->removeInfo(Core::Id(INFO_OUT_OF_SYNC)); diff --git a/src/plugins/debugger/qml/qmllivetextpreview.h b/src/plugins/debugger/qml/qmllivetextpreview.h index 55b6820b5b2..0b6a672598b 100644 --- a/src/plugins/debugger/qml/qmllivetextpreview.h +++ b/src/plugins/debugger/qml/qmllivetextpreview.h @@ -100,7 +100,7 @@ private: QmlJS::Document::Ptr m_previousDoc; QmlJS::Document::Ptr m_initialDoc; //the document that was loaded by the server - QList<QPointer<TextEditor::BaseTextEditorWidget> > m_editors; + QList<QPointer<TextEditor::TextEditorWidget> > m_editors; bool m_applyChangesToQmlInspector; QmlJS::Document::Ptr m_docWithUnappliedChanges; diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp index ca1ce39f022..b5805a95cb2 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp +++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp @@ -1785,7 +1785,7 @@ void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber, errorFormat.setUnderlineColor(Qt::red); foreach (IEditor *editor, editors) { - TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget()); + TextEditor::TextEditorWidget *ed = qobject_cast<TextEditor::TextEditorWidget *>(editor->widget()); if (!ed) continue; @@ -1806,7 +1806,7 @@ void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber, sel.format.setToolTip(errorMessage); selections.append(sel); - ed->setExtraSelections(TextEditor::BaseTextEditorWidget::DebuggerExceptionSelection, selections); + ed->setExtraSelections(TextEditor::TextEditorWidget::DebuggerExceptionSelection, selections); QString message = QString(_("%1: %2: %3")).arg(filePath).arg(lineNumber) .arg(errorMessage); @@ -1819,11 +1819,11 @@ void QmlV8DebuggerClient::clearExceptionSelection() QList<QTextEdit::ExtraSelection> selections; foreach (IEditor *editor, DocumentModel::editorsForOpenedDocuments()) { - TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget()); + TextEditor::TextEditorWidget *ed = qobject_cast<TextEditor::TextEditorWidget *>(editor->widget()); if (!ed) continue; - ed->setExtraSelections(TextEditor::BaseTextEditorWidget::DebuggerExceptionSelection, selections); + ed->setExtraSelections(TextEditor::TextEditorWidget::DebuggerExceptionSelection, selections); } } diff --git a/src/plugins/debugger/sourceagent.cpp b/src/plugins/debugger/sourceagent.cpp index f5c1639992a..294d76bfde3 100644 --- a/src/plugins/debugger/sourceagent.cpp +++ b/src/plugins/debugger/sourceagent.cpp @@ -118,7 +118,7 @@ void SourceAgent::setContent(const QString &filePath, const QString &content) QTC_ASSERT(d->editor, return); d->editor->document()->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true); - BaseTextEditorWidget *baseTextEdit = d->editor->editorWidget(); + TextEditorWidget *baseTextEdit = d->editor->editorWidget(); if (baseTextEdit) baseTextEdit->setRequestMarkEnabled(true); } else { diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp index bb29a2ca5f0..e884c2c406a 100644 --- a/src/plugins/debugger/sourceutils.cpp +++ b/src/plugins/debugger/sourceutils.cpp @@ -260,7 +260,7 @@ bool getUninitializedVariables(const Snapshot &snapshot, // Editor tooltip support -bool isCppEditor(BaseTextEditorWidget *editorWidget) +bool isCppEditor(TextEditorWidget *editorWidget) { const TextDocument *document = editorWidget->textDocument(); return ProjectFile::classify(document->filePath()) != ProjectFile::Unclassified; @@ -281,7 +281,7 @@ QString cppFunctionAt(const QString &fileName, int line, int column) // Return the Cpp expression, and, if desired, the function -QString cppExpressionAt(BaseTextEditorWidget *editorWidget, int pos, +QString cppExpressionAt(TextEditorWidget *editorWidget, int pos, int *line, int *column, QString *function /* = 0 */) { *line = *column = 0; diff --git a/src/plugins/debugger/sourceutils.h b/src/plugins/debugger/sourceutils.h index e287a46e61f..2166aac6789 100644 --- a/src/plugins/debugger/sourceutils.h +++ b/src/plugins/debugger/sourceutils.h @@ -32,15 +32,15 @@ #include <QString> -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace CPlusPlus { class Snapshot; } namespace Debugger { namespace Internal { // Editor tooltip support -bool isCppEditor(TextEditor::BaseTextEditorWidget *editorWidget); -QString cppExpressionAt(TextEditor::BaseTextEditorWidget *editorWidget, int pos, +bool isCppEditor(TextEditor::TextEditorWidget *editorWidget); +QString cppExpressionAt(TextEditor::TextEditorWidget *editorWidget, int pos, int *line, int *column, QString *function = 0); QString fixCppExpression(const QString &exp); QString cppFunctionAt(const QString &fileName, int line, int column = 0); diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index b91e1cf0f82..f5804944ab8 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -112,7 +112,7 @@ namespace Internal { * switch to design mode. * Internally manages a FormWindowEditor and uses the plain text * editable embedded in it. */ -class DesignerXmlEditorWidget : public TextEditor::BaseTextEditorWidget +class DesignerXmlEditorWidget : public TextEditor::TextEditorWidget { public: DesignerXmlEditorWidget() {} @@ -124,7 +124,7 @@ public: } }; -class FormWindowEditorFactory : public TextEditor::BaseTextEditorFactory +class FormWindowEditorFactory : public TextEditor::TextEditorFactory { public: FormWindowEditorFactory() diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp index 56ade3bd507..904fbddd89b 100644 --- a/src/plugins/diffeditor/diffeditor.cpp +++ b/src/plugins/diffeditor/diffeditor.cpp @@ -70,7 +70,7 @@ namespace DiffEditor { namespace Internal { -class DescriptionEditorWidget : public BaseTextEditorWidget +class DescriptionEditorWidget : public TextEditorWidget { Q_OBJECT public: @@ -96,7 +96,7 @@ private: }; DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent) - : BaseTextEditorWidget(parent) + : TextEditorWidget(parent) { setupFallBackEditor("DiffEditor.DescriptionEditor"); @@ -107,7 +107,7 @@ DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent) settings.m_displayFoldingMarkers = false; settings.m_markTextChanges = false; settings.m_highlightBlocks = false; - BaseTextEditorWidget::setDisplaySettings(settings); + TextEditorWidget::setDisplaySettings(settings); setCodeFoldingSupported(true); setFrameStyle(QFrame::NoFrame); @@ -117,7 +117,7 @@ DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent) QSize DescriptionEditorWidget::sizeHint() const { - QSize size = BaseTextEditorWidget::sizeHint(); + QSize size = TextEditorWidget::sizeHint(); size.setHeight(size.height() / 5); return size; } @@ -126,19 +126,19 @@ void DescriptionEditorWidget::setDisplaySettings(const DisplaySettings &ds) { DisplaySettings settings = displaySettings(); settings.m_visualizeWhitespace = ds.m_visualizeWhitespace; - BaseTextEditorWidget::setDisplaySettings(settings); + TextEditorWidget::setDisplaySettings(settings); } void DescriptionEditorWidget::setMarginSettings(const MarginSettings &ms) { Q_UNUSED(ms); - BaseTextEditorWidget::setMarginSettings(MarginSettings()); + TextEditorWidget::setMarginSettings(MarginSettings()); } void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e) { if (e->buttons()) { - BaseTextEditorWidget::mouseMoveEvent(e); + TextEditorWidget::mouseMoveEvent(e); return; } @@ -153,7 +153,7 @@ void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e) cursorShape = Qt::IBeamCursor; } - BaseTextEditorWidget::mouseMoveEvent(e); + TextEditorWidget::mouseMoveEvent(e); viewport()->setCursor(cursorShape); } @@ -168,7 +168,7 @@ void DescriptionEditorWidget::mouseReleaseEvent(QMouseEvent *e) } } - BaseTextEditorWidget::mouseReleaseEvent(e); + TextEditorWidget::mouseReleaseEvent(e); } bool DescriptionEditorWidget::findContentsUnderCursor(const QTextCursor &cursor) @@ -183,7 +183,7 @@ void DescriptionEditorWidget::highlightCurrentContents() sel.cursor = m_currentCursor; sel.cursor.select(QTextCursor::LineUnderCursor); sel.format.setFontUnderline(true); - setExtraSelections(BaseTextEditorWidget::OtherSelection, + setExtraSelections(TextEditorWidget::OtherSelection, QList<QTextEdit::ExtraSelection>() << sel); } diff --git a/src/plugins/diffeditor/diffeditor.h b/src/plugins/diffeditor/diffeditor.h index 66a045305a9..64251ef3f56 100644 --- a/src/plugins/diffeditor/diffeditor.h +++ b/src/plugins/diffeditor/diffeditor.h @@ -43,7 +43,7 @@ class QToolButton; class QStackedWidget; QT_END_NAMESPACE -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace DiffEditor { @@ -94,7 +94,7 @@ private: void writeCurrentDiffEditorSetting(QWidget *currentEditor); QSharedPointer<DiffEditorDocument> m_document; - TextEditor::BaseTextEditorWidget *m_descriptionWidget; + TextEditor::TextEditorWidget *m_descriptionWidget; QStackedWidget *m_stackedWidget; SideBySideDiffEditorWidget *m_sideBySideEditor; UnifiedDiffEditorWidget *m_unifiedEditor; diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.cpp b/src/plugins/diffeditor/selectabletexteditorwidget.cpp index 8003ecaef53..8fea31e1c5e 100644 --- a/src/plugins/diffeditor/selectabletexteditorwidget.cpp +++ b/src/plugins/diffeditor/selectabletexteditorwidget.cpp @@ -36,7 +36,7 @@ namespace DiffEditor { SelectableTextEditorWidget::SelectableTextEditorWidget(Core::Id id, QWidget *parent) - : BaseTextEditorWidget(parent) + : TextEditorWidget(parent) { setFrameStyle(QFrame::NoFrame); setupFallBackEditor(id); @@ -153,8 +153,7 @@ void SelectableTextEditorWidget::paintBlock(QPainter *painter, } newSelections += selections; - BaseTextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect); - + TextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect); } } // namespace DiffEditor diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.h b/src/plugins/diffeditor/selectabletexteditorwidget.h index a2b0b752f18..d33ec1a5976 100644 --- a/src/plugins/diffeditor/selectabletexteditorwidget.h +++ b/src/plugins/diffeditor/selectabletexteditorwidget.h @@ -48,7 +48,7 @@ public: }; class DIFFEDITOR_EXPORT SelectableTextEditorWidget - : public TextEditor::BaseTextEditorWidget + : public TextEditor::TextEditorWidget { Q_OBJECT public: diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp index e21ff18d14d..33a1c5ae3c8 100644 --- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp +++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp @@ -128,7 +128,7 @@ public: void clearAll(const QString &message); void clearAllData(); QTextBlock firstVisibleBlock() const { - return BaseTextEditorWidget::firstVisibleBlock(); + return TextEditorWidget::firstVisibleBlock(); } // void setDocuments(const QList<QPair<DiffFileInfo, QString> > &documents); @@ -294,7 +294,7 @@ SideDiffEditorWidget::SideDiffEditorWidget(QWidget *parent) settings.m_highlightBlocks = false; SelectableTextEditorWidget::setDisplaySettings(settings); - connect(this, &BaseTextEditorWidget::tooltipRequested, [this](const QPoint &point, int position) { + connect(this, &TextEditorWidget::tooltipRequested, [this](const QPoint &point, int position) { int block = document()->findBlock(position).blockNumber(); auto it = m_fileInfo.constFind(block); if (it != m_fileInfo.constEnd()) @@ -479,7 +479,7 @@ void SideDiffEditorWidget::clearAll(const QString &message) setBlockSelection(false); clear(); clearAllData(); - setExtraSelections(BaseTextEditorWidget::OtherSelection, + setExtraSelections(TextEditorWidget::OtherSelection, QList<QTextEdit::ExtraSelection>()); setPlainText(message); // m_highlighter->setDocuments(QList<QPair<DiffFileInfo, QString> >()); diff --git a/src/plugins/emacskeys/emacskeysplugin.cpp b/src/plugins/emacskeys/emacskeysplugin.cpp index e9eed25c2bb..d3cebdfb955 100644 --- a/src/plugins/emacskeys/emacskeysplugin.cpp +++ b/src/plugins/emacskeys/emacskeysplugin.cpp @@ -173,7 +173,7 @@ void EmacsKeysPlugin::currentEditorChanged(Core::IEditor *editor) } m_currentState = m_stateMap[m_currentEditorWidget]; m_currentBaseTextEditorWidget = - qobject_cast<TextEditor::BaseTextEditorWidget*>(editor->widget()); + qobject_cast<TextEditor::TextEditorWidget*>(editor->widget()); } void EmacsKeysPlugin::gotoFileStart() { genericGoto(QTextCursor::Start); } diff --git a/src/plugins/emacskeys/emacskeysplugin.h b/src/plugins/emacskeys/emacskeysplugin.h index 6eb8f2c9639..06a08dd6a31 100644 --- a/src/plugins/emacskeys/emacskeysplugin.h +++ b/src/plugins/emacskeys/emacskeysplugin.h @@ -43,7 +43,7 @@ class Id; class IEditor; } namespace TextEditor { -class BaseTextEditorWidget; +class TextEditorWidget; } namespace EmacsKeys { @@ -102,7 +102,7 @@ private: QHash<QPlainTextEdit*, EmacsKeysState*> m_stateMap; QPlainTextEdit *m_currentEditorWidget; EmacsKeysState *m_currentState; - TextEditor::BaseTextEditorWidget *m_currentBaseTextEditorWidget; + TextEditor::TextEditorWidget *m_currentBaseTextEditorWidget; }; } // namespace Internal diff --git a/src/plugins/fakevim/fakevim_test.cpp b/src/plugins/fakevim/fakevim_test.cpp index 6a202d74365..bcb6242fb25 100644 --- a/src/plugins/fakevim/fakevim_test.cpp +++ b/src/plugins/fakevim/fakevim_test.cpp @@ -187,7 +187,7 @@ struct FakeVimPlugin::TestData int oldPosition; QByteArray oldText; - BaseTextEditorWidget *editor() const { return qobject_cast<BaseTextEditorWidget *>(edit); } + TextEditorWidget *editor() const { return qobject_cast<TextEditorWidget *>(edit); } QTextCursor cursor() const { return editor()->textCursor(); } diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 0f70cccd1f3..32ec5fd7658 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -240,7 +240,7 @@ class RelativeNumbersColumn : public QWidget Q_OBJECT public: - RelativeNumbersColumn(BaseTextEditorWidget *baseTextEditor) + RelativeNumbersColumn(TextEditorWidget *baseTextEditor) : QWidget(baseTextEditor) , m_currentPos(0) , m_lineSpacing(0) @@ -352,7 +352,7 @@ private slots: private: int m_currentPos; int m_lineSpacing; - BaseTextEditorWidget *m_editor; + TextEditorWidget *m_editor; QTimer m_timerUpdate; }; @@ -845,7 +845,7 @@ public: if (!m_handler) return; - BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(handler->widget()); + TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(handler->widget()); if (!editor) return; @@ -898,7 +898,7 @@ public: return text() == m_provider->needle(); } - void applyContextualContent(BaseTextEditorWidget *, int) const Q_DECL_OVERRIDE + void applyContextualContent(TextEditorWidget *, int) const Q_DECL_OVERRIDE { QTC_ASSERT(m_provider->handler(), return); m_provider->handler()->handleReplay(text().mid(m_provider->needle().size())); @@ -1281,7 +1281,7 @@ void FakeVimPluginPrivate::userActionTriggered() void FakeVimPluginPrivate::createRelativeNumberWidget(IEditor *editor) { - if (BaseTextEditorWidget *textEditor = qobject_cast<BaseTextEditorWidget *>(editor->widget())) { + if (TextEditorWidget *textEditor = qobject_cast<TextEditorWidget *>(editor->widget())) { RelativeNumbersColumn *relativeNumbers = new RelativeNumbersColumn(textEditor); connect(theFakeVimSetting(ConfigRelativeNumber), SIGNAL(valueChanged(QVariant)), relativeNumbers, SLOT(deleteLater())); @@ -1574,7 +1574,7 @@ void FakeVimPluginPrivate::foldToggle(int depth) void FakeVimPluginPrivate::foldAll(bool fold) { IEditor *ieditor = EditorManager::currentEditor(); - BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(ieditor->widget()); + TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(ieditor->widget()); QTC_ASSERT(editor != 0, return); QTextDocument *doc = editor->document(); @@ -1597,7 +1597,7 @@ void FakeVimPluginPrivate::fold(int depth, bool fold) IEditor *ieditor = EditorManager::currentEditor(); FakeVimHandler *handler = m_editorToHandler.value(ieditor, 0); QTC_ASSERT(handler != 0, return); - BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(ieditor->widget()); + TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(ieditor->widget()); QTC_ASSERT(editor != 0, return); QTextDocument *doc = editor->document(); @@ -1887,7 +1887,7 @@ void FakeVimPluginPrivate::triggerCompletions() FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); if (!handler) return; - if (BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(handler->widget())) + if (TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(handler->widget())) editor->invokeAssist(Completion, m_wordProvider); // CompletionSupport::instance()->complete(editor->editor(), TextCompletion, false); } @@ -1903,7 +1903,7 @@ void FakeVimPluginPrivate::disableBlockSelection() FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); if (!handler) return; - if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) + if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget())) bt->setBlockSelection(false); } @@ -1912,7 +1912,7 @@ void FakeVimPluginPrivate::setBlockSelection(const QTextCursor &cursor) FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); if (!handler) return; - if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) + if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget())) bt->setBlockSelection(cursor); } @@ -1921,7 +1921,7 @@ void FakeVimPluginPrivate::blockSelection(QTextCursor *cursor) FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); if (!handler) return; - if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) + if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget())) if (cursor) *cursor = bt->blockSelection(); } @@ -1931,7 +1931,7 @@ void FakeVimPluginPrivate::hasBlockSelection(bool *on) FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); if (!handler) return; - if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) + if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget())) *on = bt->hasBlockSelection(); } @@ -1948,7 +1948,7 @@ void FakeVimPluginPrivate::checkForElectricCharacter(bool *result, QChar c) FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); if (!handler) return; - if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) + if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget())) *result = bt->textDocument()->indenter()->isElectricCharacter(c); } @@ -2120,7 +2120,7 @@ void FakeVimPluginPrivate::indentRegion(int beginBlock, int endBlock, if (!handler) return; - BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget()); + TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()); if (!bt) return; @@ -2183,8 +2183,8 @@ void FakeVimPluginPrivate::showExtraInformation(const QString &text) void FakeVimPluginPrivate::changeSelection(const QList<QTextEdit::ExtraSelection> &selection) { if (FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender())) - if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) - bt->setExtraSelections(BaseTextEditorWidget::FakeVimSelection, selection); + if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget())) + bt->setExtraSelections(TextEditorWidget::FakeVimSelection, selection); } void FakeVimPluginPrivate::highlightMatches(const QString &needle) diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.h b/src/plugins/genericprojectmanager/genericprojectfileseditor.h index ec947ef0069..734d37c8536 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.h +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.h @@ -35,7 +35,7 @@ namespace GenericProjectManager { namespace Internal { -class ProjectFilesFactory : public TextEditor::BaseTextEditorFactory +class ProjectFilesFactory : public TextEditor::TextEditorFactory { public: ProjectFilesFactory(); diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 51f825c02f5..631c3f4dbcd 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -109,7 +109,7 @@ protected: // GlslEditorWidget // -class GlslEditorWidget : public BaseTextEditorWidget +class GlslEditorWidget : public TextEditorWidget { public: GlslEditorWidget(); @@ -167,7 +167,7 @@ GlslEditorWidget::GlslEditorWidget() policy.setHorizontalPolicy(QSizePolicy::Expanding); m_outlineCombo->setSizePolicy(policy); - insertExtraToolBarWidget(BaseTextEditorWidget::Left, m_outlineCombo); + insertExtraToolBarWidget(TextEditorWidget::Left, m_outlineCombo); // if (m_modelManager) { // m_semanticHighlighter->setModelManager(m_modelManager); @@ -319,7 +319,7 @@ AssistInterface *GlslEditorWidget::createAssistInterface( reason, textDocument()->mimeType(), m_glslDocument); - return BaseTextEditorWidget::createAssistInterface(kind, reason); + return TextEditorWidget::createAssistInterface(kind, reason); } diff --git a/src/plugins/glsleditor/glsleditor.h b/src/plugins/glsleditor/glsleditor.h index 2da6181aea3..32279fcbbdd 100644 --- a/src/plugins/glsleditor/glsleditor.h +++ b/src/plugins/glsleditor/glsleditor.h @@ -37,7 +37,7 @@ namespace Internal { int languageVariant(const QString &mimeType); -class GlslEditorFactory : public TextEditor::BaseTextEditorFactory +class GlslEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/glsleditor/glslhoverhandler.cpp b/src/plugins/glsleditor/glslhoverhandler.cpp index c38bf6b73d4..be76a9f2caa 100644 --- a/src/plugins/glsleditor/glslhoverhandler.cpp +++ b/src/plugins/glsleditor/glslhoverhandler.cpp @@ -53,7 +53,7 @@ bool GlslHoverHandler::acceptEditor(IEditor *editor) return editor->context().contains(Constants::C_GLSLEDITOR_ID); } -void GlslHoverHandler::identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos) +void GlslHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) { if (!editorWidget->extraSelectionTooltip(pos).isEmpty()) setToolTip(editorWidget->extraSelectionTooltip(pos)); diff --git a/src/plugins/glsleditor/glslhoverhandler.h b/src/plugins/glsleditor/glslhoverhandler.h index a4d63692b2a..9df874b63ae 100644 --- a/src/plugins/glsleditor/glslhoverhandler.h +++ b/src/plugins/glsleditor/glslhoverhandler.h @@ -50,7 +50,7 @@ public: private: virtual bool acceptEditor(Core::IEditor *editor); - virtual void identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos); + virtual void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos); virtual void decorateToolTip(); }; diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index ec668dec2c0..4dc5ff21afb 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -254,7 +254,7 @@ void EditorConfiguration::fromMap(const QVariantMap &map) void EditorConfiguration::configureEditor(BaseTextEditor *textEditor) const { - BaseTextEditorWidget *widget = textEditor->editorWidget(); + TextEditorWidget *widget = textEditor->editorWidget(); if (widget) widget->setCodeStyle(codeStyle(widget->languageSettingsId())); if (!d->m_useGlobal) { @@ -267,7 +267,7 @@ void EditorConfiguration::configureEditor(BaseTextEditor *textEditor) const void EditorConfiguration::deconfigureEditor(BaseTextEditor *textEditor) const { - BaseTextEditorWidget *widget = textEditor->editorWidget(); + TextEditorWidget *widget = textEditor->editorWidget(); if (widget) widget->setCodeStyle(TextEditorSettings::codeStyle(widget->languageSettingsId())); @@ -282,7 +282,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use) d->m_defaultCodeStyle->setCurrentDelegate(d->m_useGlobal ? TextEditorSettings::codeStyle() : 0); foreach (Core::IEditor *editor, Core::DocumentModel::editorsForOpenedDocuments()) { - if (BaseTextEditorWidget *widget = qobject_cast<BaseTextEditorWidget *>(editor->widget())) { + if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget())) { Project *project = SessionManager::projectForFile(editor->document()->filePath()); if (project && project->editorConfiguration() == this) switchSettings(widget); @@ -291,7 +291,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use) } static void switchSettings_helper(const QObject *newSender, const QObject *oldSender, - BaseTextEditorWidget *widget) + TextEditorWidget *widget) { QObject::disconnect(oldSender, SIGNAL(marginSettingsChanged(TextEditor::MarginSettings)), widget, SLOT(setMarginSettings(TextEditor::MarginSettings))); @@ -316,7 +316,7 @@ static void switchSettings_helper(const QObject *newSender, const QObject *oldSe widget, SLOT(setExtraEncodingSettings(TextEditor::ExtraEncodingSettings))); } -void EditorConfiguration::switchSettings(BaseTextEditorWidget *widget) const +void EditorConfiguration::switchSettings(TextEditorWidget *widget) const { if (d->m_useGlobal) { widget->setMarginSettings(TextEditorSettings::marginSettings()); diff --git a/src/plugins/projectexplorer/editorconfiguration.h b/src/plugins/projectexplorer/editorconfiguration.h index 54c3972215f..f8043550e4b 100644 --- a/src/plugins/projectexplorer/editorconfiguration.h +++ b/src/plugins/projectexplorer/editorconfiguration.h @@ -42,7 +42,7 @@ class Id; namespace TextEditor { class BaseTextEditor; -class BaseTextEditorWidget; +class TextEditorWidget; class TextDocument; class TabSettings; class ICodeStylePreferences; @@ -112,7 +112,7 @@ private slots: void slotAboutToRemoveProject(ProjectExplorer::Project *project); void editorsClosed(const QList<Core::IEditor*> &closedEditors); private: - void switchSettings(TextEditor::BaseTextEditorWidget *baseTextEditor) const; + void switchSettings(TextEditor::TextEditorWidget *baseTextEditor) const; EditorConfigurationPrivate *d; }; diff --git a/src/plugins/projectexplorer/environmentitemswidget.cpp b/src/plugins/projectexplorer/environmentitemswidget.cpp index e5f058ece73..c07323fa00e 100644 --- a/src/plugins/projectexplorer/environmentitemswidget.cpp +++ b/src/plugins/projectexplorer/environmentitemswidget.cpp @@ -44,7 +44,7 @@ class EnvironmentItemsWidgetPrivate public: QList<Utils::EnvironmentItem> cleanUp( const QList<Utils::EnvironmentItem> &items) const; - TextEditor::BaseTextEditorWidget *m_editor; + TextEditor::TextEditorWidget *m_editor; }; QList<Utils::EnvironmentItem> EnvironmentItemsWidgetPrivate::cleanUp( diff --git a/src/plugins/pythoneditor/pythoneditor.cpp b/src/plugins/pythoneditor/pythoneditor.cpp index 6e35ed87b0b..8632d76bb0c 100644 --- a/src/plugins/pythoneditor/pythoneditor.cpp +++ b/src/plugins/pythoneditor/pythoneditor.cpp @@ -48,7 +48,7 @@ namespace Internal { // PythonEditorWidget // -class PythonEditorWidget : public BaseTextEditorWidget +class PythonEditorWidget : public TextEditorWidget { public: PythonEditorWidget() diff --git a/src/plugins/pythoneditor/pythoneditor.h b/src/plugins/pythoneditor/pythoneditor.h index a663dc0de00..4b40574c0c2 100644 --- a/src/plugins/pythoneditor/pythoneditor.h +++ b/src/plugins/pythoneditor/pythoneditor.h @@ -35,7 +35,7 @@ namespace PythonEditor { namespace Internal { -class PythonEditorFactory : public TextEditor::BaseTextEditorFactory +class PythonEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/qmakeprojectmanager/profileeditor.cpp b/src/plugins/qmakeprojectmanager/profileeditor.cpp index 7ce1ff7a720..d48e452f0ee 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.cpp +++ b/src/plugins/qmakeprojectmanager/profileeditor.cpp @@ -51,7 +51,7 @@ using namespace TextEditor; namespace QmakeProjectManager { namespace Internal { -class ProFileEditorWidget : public BaseTextEditorWidget +class ProFileEditorWidget : public TextEditorWidget { public: ProFileEditorWidget() diff --git a/src/plugins/qmakeprojectmanager/profileeditor.h b/src/plugins/qmakeprojectmanager/profileeditor.h index 19a1ff7b692..474fe456dc5 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.h +++ b/src/plugins/qmakeprojectmanager/profileeditor.h @@ -35,7 +35,7 @@ namespace QmakeProjectManager { namespace Internal { -class ProFileEditorFactory : public TextEditor::BaseTextEditorFactory +class ProFileEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp index e2bd138aa0b..a48d33a3e98 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp @@ -58,7 +58,7 @@ bool ProFileHoverHandler::acceptEditor(IEditor *editor) return editor->context().contains(Constants::PROFILE_EDITOR_ID); } -void ProFileHoverHandler::identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos) +void ProFileHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) { m_docFragment.clear(); m_manualKind = UnknownManual; diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.h b/src/plugins/qmakeprojectmanager/profilehoverhandler.h index fde0b0a26ee..0ec99fc2d08 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.h +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.h @@ -50,7 +50,7 @@ signals: private: virtual bool acceptEditor(Core::IEditor *editor); - virtual void identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos); + virtual void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos); void identifyQMakeKeyword(const QString &text, int pos); enum ManualKind { diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index 6f6889ee4d4..a3ed9cb8bcf 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -237,7 +237,7 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit) connect(edit, SIGNAL(modificationChanged(bool)), this, SIGNAL(dirtyStateChanged(bool))); - m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit()))); + m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit()))); m_documentModel->setTextModifier(m_documentTextModifier.data()); m_inFileComponentTextModifier.reset(); diff --git a/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h b/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h index 1f9e8d7eb86..d3218833673 100644 --- a/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h +++ b/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h @@ -45,7 +45,7 @@ namespace QmlDesigner { class QMLDESIGNERCORE_EXPORT BaseTextEditModifier: public PlainTextEditModifier { public: - BaseTextEditModifier(TextEditor::BaseTextEditorWidget *textEdit); + BaseTextEditModifier(TextEditor::TextEditorWidget *textEdit); virtual void indent(int offset, int length); diff --git a/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp b/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp index 5119b1f899d..c64a78db71f 100644 --- a/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp +++ b/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp @@ -37,7 +37,7 @@ using namespace QmlDesigner; -BaseTextEditModifier::BaseTextEditModifier(TextEditor::BaseTextEditorWidget *textEdit): +BaseTextEditModifier::BaseTextEditModifier(TextEditor::TextEditorWidget *textEdit): PlainTextEditModifier(textEdit) { } @@ -47,7 +47,7 @@ void BaseTextEditModifier::indent(int offset, int length) if (length == 0 || offset < 0 || offset + length >= text().length()) return; - if (TextEditor::BaseTextEditorWidget *baseTextEditorWidget = qobject_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit())) { + if (TextEditor::TextEditorWidget *baseTextEditorWidget = qobject_cast<TextEditor::TextEditorWidget*>(plainTextEdit())) { TextEditor::TextDocument *baseTextEditorDocument = baseTextEditorWidget->textDocument(); QTextDocument *textDocument = baseTextEditorWidget->document(); @@ -81,7 +81,7 @@ void BaseTextEditModifier::indent(int offset, int length) int BaseTextEditModifier::indentDepth() const { - if (TextEditor::BaseTextEditorWidget *bte = qobject_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit())) + if (TextEditor::TextEditorWidget *bte = qobject_cast<TextEditor::TextEditorWidget*>(plainTextEdit())) return bte->textDocument()->tabSettings().m_indentSize; else return 0; @@ -89,7 +89,7 @@ int BaseTextEditModifier::indentDepth() const bool BaseTextEditModifier::renameId(const QString &oldId, const QString &newId) { - if (TextEditor::BaseTextEditorWidget *bte = qobject_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit())) { + if (TextEditor::TextEditorWidget *bte = qobject_cast<TextEditor::TextEditorWidget*>(plainTextEdit())) { if (QmlJSEditor::QmlJSEditorDocument *document = qobject_cast<QmlJSEditor::QmlJSEditorDocument *>(bte->textDocument())) { Utils::ChangeSet changeSet; diff --git a/src/plugins/qmljseditor/qmljscompletionassist.cpp b/src/plugins/qmljseditor/qmljscompletionassist.cpp index f04f3b73fba..bd5b58ea53b 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.cpp +++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp @@ -352,7 +352,7 @@ bool QmlJSAssistProposalItem::prematurelyApplies(const QChar &c) const || (text().endsWith(QLatin1Char('.')) && c == QLatin1Char('.')); } -void QmlJSAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, +void QmlJSAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const { const int currentPosition = editorWidget->position(); diff --git a/src/plugins/qmljseditor/qmljscompletionassist.h b/src/plugins/qmljseditor/qmljscompletionassist.h index a932b7033b4..5febe48ea2c 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.h +++ b/src/plugins/qmljseditor/qmljscompletionassist.h @@ -56,7 +56,7 @@ class QmlJSAssistProposalItem : public TextEditor::AssistProposalItem { public: bool prematurelyApplies(const QChar &c) const Q_DECL_OVERRIDE; - void applyContextualContent(TextEditor::BaseTextEditorWidget *editorWidget, + void applyContextualContent(TextEditor::TextEditorWidget *editorWidget, int basePosition) const Q_DECL_OVERRIDE; }; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 4e40f33c0ac..fce43670da2 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -487,7 +487,7 @@ void QmlJSEditorWidget::setSelectedElements() void QmlJSEditorWidget::applyFontSettings() { - BaseTextEditorWidget::applyFontSettings(); + TextEditorWidget::applyFontSettings(); if (!m_qmlJsEditorDocument->isSemanticInfoOutdated()) updateUses(); } @@ -553,10 +553,10 @@ void QmlJSEditorWidget::createToolBar() connect(this, &QmlJSEditorWidget::cursorPositionChanged, &m_updateOutlineIndexTimer, static_cast<void (QTimer::*)()>(&QTimer::start)); - insertExtraToolBarWidget(BaseTextEditorWidget::Left, m_outlineCombo); + insertExtraToolBarWidget(TextEditorWidget::Left, m_outlineCombo); } -BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, +TextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, bool /*resolveTarget*/, bool /*inNextSplit*/) { @@ -573,7 +573,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs // if it's a file import, link to the file foreach (const ImportInfo &import, semanticInfo.document->bind()->imports()) { if (import.ast() == importAst && import.type() == ImportType::File) { - BaseTextEditorWidget::Link link(import.path()); + TextEditorWidget::Link link(import.path()); link.linkTextStart = importAst->firstSourceLocation().begin(); link.linkTextEnd = importAst->lastSourceLocation().end(); return link; @@ -585,7 +585,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs // string literals that could refer to a file link to them if (StringLiteral *literal = cast<StringLiteral *>(node)) { const QString &text = literal->value.toString(); - BaseTextEditorWidget::Link link; + TextEditorWidget::Link link; link.linkTextStart = literal->literalToken.begin(); link.linkTextEnd = literal->literalToken.end(); if (semanticInfo.snapshot.document(text)) { @@ -611,7 +611,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs if (! (value && value->getSourceLocation(&fileName, &line, &column))) return Link(); - BaseTextEditorWidget::Link link; + TextEditorWidget::Link link; link.targetFileName = fileName; link.targetLine = line; link.targetColumn = column - 1; // adjust the column @@ -738,7 +738,7 @@ bool QmlJSEditorWidget::event(QEvent *e) break; } - return BaseTextEditorWidget::event(e); + return TextEditorWidget::event(e); } @@ -748,7 +748,7 @@ void QmlJSEditorWidget::wheelEvent(QWheelEvent *event) if (m_contextPane && m_contextPane->widget()->isVisible()) visible = true; - BaseTextEditorWidget::wheelEvent(event); + TextEditorWidget::wheelEvent(event); if (visible) m_contextPane->apply(this, m_qmlJsEditorDocument->semanticInfo().document, 0, @@ -758,13 +758,13 @@ void QmlJSEditorWidget::wheelEvent(QWheelEvent *event) void QmlJSEditorWidget::resizeEvent(QResizeEvent *event) { - BaseTextEditorWidget::resizeEvent(event); + TextEditorWidget::resizeEvent(event); hideContextPane(); } void QmlJSEditorWidget::scrollContentsBy(int dx, int dy) { - BaseTextEditorWidget::scrollContentsBy(dx, dy); + TextEditorWidget::scrollContentsBy(dx, dy); hideContextPane(); } @@ -858,7 +858,7 @@ QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const return QLatin1String("id: ") + objectId + QLatin1String("..."); } - return TextEditor::BaseTextEditorWidget::foldReplacementText(block); + return TextEditor::TextEditorWidget::foldReplacementText(block); } diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 6f629fbca62..9f79b8891f3 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -59,7 +59,7 @@ class FindReferences; namespace Internal { -class QmlJSEditorWidget : public TextEditor::BaseTextEditorWidget +class QmlJSEditorWidget : public TextEditor::TextEditorWidget { Q_OBJECT @@ -106,7 +106,7 @@ protected: void scrollContentsBy(int dx, int dy); void applyFontSettings(); void createToolBar(); - TextEditor::BaseTextEditorWidget::Link findLinkAt(const QTextCursor &cursor, + TextEditor::TextEditorWidget::Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true, bool inNextSplit = false); QString foldReplacementText(const QTextBlock &block) const; @@ -148,7 +148,7 @@ public: bool isDesignModePreferred() const; }; -class QmlJSEditorFactory : public TextEditor::BaseTextEditorFactory +class QmlJSEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index 487f737b674..4a893f427bf 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -180,7 +180,7 @@ bool QmlJSHoverHandler::setQmlTypeHelp(const ScopeChain &scopeChain, const Docum return true; } -void QmlJSHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int pos) +void QmlJSHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos) { reset(); @@ -256,7 +256,7 @@ void QmlJSHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int po bool QmlJSHoverHandler::matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos) { foreach (const QTextEdit::ExtraSelection &sel, - qmlEditor->extraSelections(BaseTextEditorWidget::CodeWarningsSelection)) { + qmlEditor->extraSelections(TextEditorWidget::CodeWarningsSelection)) { if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) { setToolTip(sel.format.toolTip()); return true; @@ -372,7 +372,7 @@ void QmlJSHoverHandler::reset() m_colorTip = QColor(); } -void QmlJSHoverHandler::operateTooltip(BaseTextEditorWidget *editorWidget, const QPoint &point) +void QmlJSHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) { if (toolTip().isEmpty()) Utils::ToolTip::hide(); diff --git a/src/plugins/qmljseditor/qmljshoverhandler.h b/src/plugins/qmljseditor/qmljshoverhandler.h index c0fe356fdfd..3d42ea8d336 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.h +++ b/src/plugins/qmljseditor/qmljshoverhandler.h @@ -66,8 +66,8 @@ private: void reset(); bool acceptEditor(Core::IEditor *editor); - void identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos); - void operateTooltip(TextEditor::BaseTextEditorWidget *editorWidget, const QPoint &point); + void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos); + void operateTooltip(TextEditor::TextEditorWidget *editorWidget, const QPoint &point); bool matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos); bool matchColorItem(const QmlJS::ScopeChain &lookupContext, diff --git a/src/plugins/qmljseditor/quicktoolbar.cpp b/src/plugins/qmljseditor/quicktoolbar.cpp index 1640ffb0469..d1fbb3725d5 100644 --- a/src/plugins/qmljseditor/quicktoolbar.cpp +++ b/src/plugins/qmljseditor/quicktoolbar.cpp @@ -115,7 +115,7 @@ QuickToolBar::~QuickToolBar() m_widget = 0; } -void QuickToolBar::apply(TextEditor::BaseTextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force) +void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force) { if (!QuickToolBarSettings::get().enableContextPane && !force && !update) { contextWidget()->hide(); @@ -245,7 +245,7 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorWidget *editorWidget, Documen } -bool QuickToolBar::isAvailable(TextEditor::BaseTextEditorWidget *, Document::Ptr document, AST::Node *node) +bool QuickToolBar::isAvailable(TextEditor::TextEditorWidget *, Document::Ptr document, AST::Node *node) { if (document.isNull()) return false; diff --git a/src/plugins/qmljseditor/quicktoolbar.h b/src/plugins/qmljseditor/quicktoolbar.h index 38c28d73ad7..33810bad50d 100644 --- a/src/plugins/qmljseditor/quicktoolbar.h +++ b/src/plugins/qmljseditor/quicktoolbar.h @@ -45,8 +45,8 @@ class QuickToolBar : public QmlJS::IContextPane public: QuickToolBar(QObject *parent = 0); ~QuickToolBar(); - void apply(TextEditor::BaseTextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false); - bool isAvailable(TextEditor::BaseTextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node); + void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false); + bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node); void setProperty(const QString &propertyName, const QVariant &value); void removeProperty(const QString &propertyName); void setEnabled(bool); @@ -66,7 +66,7 @@ private: QPointer<QmlEditorWidgets::ContextPaneWidget> m_widget; QmlJS::Document::Ptr m_doc; QmlJS::AST::Node *m_node; - TextEditor::BaseTextEditorWidget *m_editorWidget; + TextEditor::TextEditorWidget *m_editorWidget; bool m_blockWriting; QStringList m_propertyOrder; QStringList m_prototypes; diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp index 011e92cc9b9..673a5495709 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp @@ -105,7 +105,7 @@ QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file(const QString &fileName) c } QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file( - TextEditor::BaseTextEditorWidget *editor, const Document::Ptr &document) + TextEditor::TextEditorWidget *editor, const Document::Ptr &document) { return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(editor, document)); } @@ -128,7 +128,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(const QString &fileName, const QShare m_fileName.clear(); } -QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::BaseTextEditorWidget *editor, QmlJS::Document::Ptr document) +QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, QmlJS::Document::Ptr document) : RefactoringFile(editor) , m_qmljsDocument(document) { diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.h b/src/plugins/qmljstools/qmljsrefactoringchanges.h index 966417f79f0..ac04af3fc28 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.h +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.h @@ -62,7 +62,7 @@ public: protected: QmlJSRefactoringFile(const QString &fileName, const QSharedPointer<TextEditor::RefactoringChangesData> &data); - QmlJSRefactoringFile(TextEditor::BaseTextEditorWidget *editor, QmlJS::Document::Ptr document); + QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, QmlJS::Document::Ptr document); QmlJSRefactoringChangesData *data() const; virtual void fileChanged(); @@ -79,7 +79,7 @@ public: QmlJSRefactoringChanges(QmlJS::ModelManagerInterface *modelManager, const QmlJS::Snapshot &snapshot); - static QmlJSRefactoringFilePtr file(TextEditor::BaseTextEditorWidget *editor, + static QmlJSRefactoringFilePtr file(TextEditor::TextEditorWidget *editor, const QmlJS::Document::Ptr &document); QmlJSRefactoringFilePtr file(const QString &fileName) const; diff --git a/src/plugins/qnx/bardescriptoreditorfactory.cpp b/src/plugins/qnx/bardescriptoreditorfactory.cpp index 2bf90396f96..93424cb7208 100644 --- a/src/plugins/qnx/bardescriptoreditorfactory.cpp +++ b/src/plugins/qnx/bardescriptoreditorfactory.cpp @@ -50,7 +50,7 @@ public: { } protected: - TextEditor::BaseTextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const + TextEditor::TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const { BarDescriptorEditorWidget *w = qobject_cast<BarDescriptorEditorWidget *>(editor->widget()); return w ? w->sourceWidget() : 0; diff --git a/src/plugins/qnx/bardescriptoreditorwidget.cpp b/src/plugins/qnx/bardescriptoreditorwidget.cpp index bcbd234b53a..9d4de86574c 100644 --- a/src/plugins/qnx/bardescriptoreditorwidget.cpp +++ b/src/plugins/qnx/bardescriptoreditorwidget.cpp @@ -168,11 +168,11 @@ void BarDescriptorEditorWidget::initAssetsPage() void BarDescriptorEditorWidget::initSourcePage() { - BaseTextDocumentPtr doc(new TextDocument); + TextDocumentPtr doc(new TextDocument); doc->setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); // FIXME: This looks odd. doc->setIndenter(new TextEditor::NormalIndenter); - m_xmlSourceWidget = new TextEditor::BaseTextEditorWidget(this); + m_xmlSourceWidget = new TextEditor::TextEditorWidget(this); m_xmlSourceWidget->setTextDocument(doc); m_xmlSourceWidget->setupAsPlainEditor(); addWidget(m_xmlSourceWidget); @@ -186,7 +186,7 @@ void BarDescriptorEditorWidget::initPanelSize(ProjectExplorer::PanelsWidget *pan panelsWidget->widget()->setMinimumWidth(0); } -TextEditor::BaseTextEditorWidget *BarDescriptorEditorWidget::sourceWidget() const +TextEditor::TextEditorWidget *BarDescriptorEditorWidget::sourceWidget() const { return m_xmlSourceWidget; } diff --git a/src/plugins/qnx/bardescriptoreditorwidget.h b/src/plugins/qnx/bardescriptoreditorwidget.h index 0c2251a4986..d006ef4bbd5 100644 --- a/src/plugins/qnx/bardescriptoreditorwidget.h +++ b/src/plugins/qnx/bardescriptoreditorwidget.h @@ -40,7 +40,7 @@ namespace Core { class IEditor; } namespace ProjectExplorer { class PanelsWidget; } -namespace TextEditor { class BaseTextEditorWidget; } +namespace TextEditor { class TextEditorWidget; } namespace Qnx { namespace Internal { @@ -61,7 +61,7 @@ class BarDescriptorEditorWidget : public QStackedWidget public: explicit BarDescriptorEditorWidget(BarDescriptorEditor *editor, QWidget *parent = 0); - TextEditor::BaseTextEditorWidget *sourceWidget() const; + TextEditor::TextEditorWidget *sourceWidget() const; void setFilePath(const QString &filePath); @@ -94,7 +94,7 @@ private: BarDescriptorEditorAssetsWidget *m_assetsWidget; - TextEditor::BaseTextEditorWidget *m_xmlSourceWidget; + TextEditor::TextEditorWidget *m_xmlSourceWidget; }; diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index c4c0457aa7f..82972ccd90a 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -66,7 +66,7 @@ void BaseHoverHandler::editorOpened(Core::IEditor *editor) void BaseHoverHandler::showToolTip(BaseTextEditor *editor, const QPoint &point, int pos) { - BaseTextEditorWidget *editorWidget = editor->editorWidget(); + TextEditorWidget *editorWidget = editor->editorWidget(); editor->setContextHelpId(QString()); @@ -158,7 +158,7 @@ void BaseHoverHandler::decorateToolTip() } } -void BaseHoverHandler::operateTooltip(BaseTextEditorWidget *editorWidget, const QPoint &point) +void BaseHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) { if (m_toolTip.isEmpty()) Utils::ToolTip::hide(); diff --git a/src/plugins/texteditor/basehoverhandler.h b/src/plugins/texteditor/basehoverhandler.h index 16611c6f48c..adaa382d3e9 100644 --- a/src/plugins/texteditor/basehoverhandler.h +++ b/src/plugins/texteditor/basehoverhandler.h @@ -39,7 +39,7 @@ namespace Core { class IEditor; } namespace TextEditor { class BaseTextEditor; -class BaseTextEditorWidget; +class TextEditorWidget; class TEXTEDITOR_EXPORT BaseHoverHandler : public QObject { @@ -71,9 +71,9 @@ private: void process(BaseTextEditor *editor, int pos); virtual bool acceptEditor(Core::IEditor *editor) = 0; - virtual void identifyMatch(BaseTextEditorWidget *editorWidget, int pos) = 0; + virtual void identifyMatch(TextEditorWidget *editorWidget, int pos) = 0; virtual void decorateToolTip(); - virtual void operateTooltip(BaseTextEditorWidget *editorWidget, const QPoint &point); + virtual void operateTooltip(TextEditorWidget *editorWidget, const QPoint &point); bool m_diagnosticTooltip; QString m_toolTip; diff --git a/src/plugins/texteditor/circularclipboardassist.cpp b/src/plugins/texteditor/circularclipboardassist.cpp index 15f6d699da4..29aef71169c 100644 --- a/src/plugins/texteditor/circularclipboardassist.cpp +++ b/src/plugins/texteditor/circularclipboardassist.cpp @@ -62,7 +62,7 @@ public: setText(text); } - void apply(BaseTextEditorWidget *editorWidget, int /*basePosition*/) const Q_DECL_OVERRIDE + void apply(TextEditorWidget *editorWidget, int /*basePosition*/) const Q_DECL_OVERRIDE { //Move to last in circular clipboard @@ -73,7 +73,7 @@ public: //Copy the selected item QApplication::clipboard()->setMimeData( - BaseTextEditorWidget::duplicateMimeData(m_mimeData.data())); + TextEditorWidget::duplicateMimeData(m_mimeData.data())); //Paste editorWidget->paste(); diff --git a/src/plugins/texteditor/codeassist/assistproposalitem.cpp b/src/plugins/texteditor/codeassist/assistproposalitem.cpp index 125f1b630c9..343c89b2557 100644 --- a/src/plugins/texteditor/codeassist/assistproposalitem.cpp +++ b/src/plugins/texteditor/codeassist/assistproposalitem.cpp @@ -132,7 +132,7 @@ bool AssistProposalItem::prematurelyApplies(const QChar &c) const return false; } -void AssistProposalItem::apply(BaseTextEditorWidget *editorWidget, int basePosition) const +void AssistProposalItem::apply(TextEditorWidget *editorWidget, int basePosition) const { if (data().canConvert<QString>()) applySnippet(editorWidget, basePosition); @@ -142,21 +142,21 @@ void AssistProposalItem::apply(BaseTextEditorWidget *editorWidget, int basePosit applyContextualContent(editorWidget, basePosition); } -void AssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const +void AssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const { const int currentPosition = editorWidget->position(); editorWidget->setCursorPosition(basePosition); editorWidget->replace(currentPosition - basePosition, text()); } -void AssistProposalItem::applySnippet(BaseTextEditorWidget *editorWidget, int basePosition) const +void AssistProposalItem::applySnippet(TextEditorWidget *editorWidget, int basePosition) const { QTextCursor tc = editorWidget->textCursor(); tc.setPosition(basePosition, QTextCursor::KeepAnchor); editorWidget->insertCodeSnippet(tc, data().toString()); } -void AssistProposalItem::applyQuickFix(BaseTextEditorWidget *editorWidget, int basePosition) const +void AssistProposalItem::applyQuickFix(TextEditorWidget *editorWidget, int basePosition) const { Q_UNUSED(editorWidget) Q_UNUSED(basePosition) diff --git a/src/plugins/texteditor/codeassist/assistproposalitem.h b/src/plugins/texteditor/codeassist/assistproposalitem.h index 3e9d9820998..b0d9d0a4cc4 100644 --- a/src/plugins/texteditor/codeassist/assistproposalitem.h +++ b/src/plugins/texteditor/codeassist/assistproposalitem.h @@ -39,7 +39,7 @@ namespace TextEditor { -class BaseTextEditorWidget; +class TextEditorWidget; class TEXTEDITOR_EXPORT AssistProposalItem { @@ -50,7 +50,7 @@ public: virtual QString text() const; virtual bool implicitlyApplies() const; virtual bool prematurelyApplies(const QChar &c) const; - virtual void apply(BaseTextEditorWidget *editorWidget, int basePosition) const; + virtual void apply(TextEditorWidget *editorWidget, int basePosition) const; void setIcon(const QIcon &icon); const QIcon &icon() const; @@ -66,9 +66,9 @@ public: int order() const; void setOrder(int order); - virtual void applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const; - virtual void applySnippet(BaseTextEditorWidget *editorWidget, int basePosition) const; - virtual void applyQuickFix(BaseTextEditorWidget *editorWidget, int basePosition) const; + virtual void applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const; + virtual void applySnippet(TextEditorWidget *editorWidget, int basePosition) const; + virtual void applyQuickFix(TextEditorWidget *editorWidget, int basePosition) const; private: QIcon m_icon; diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index cf2088b8a7a..9eda67e151a 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -59,7 +59,7 @@ class CodeAssistantPrivate : public QObject public: CodeAssistantPrivate(CodeAssistant *assistant); - void configure(BaseTextEditorWidget *editorWidget); + void configure(TextEditorWidget *editorWidget); bool isConfigured() const; void invoke(AssistKind kind, IAssistProvider *provider = 0); @@ -95,7 +95,7 @@ private: private: CodeAssistant *q; - BaseTextEditorWidget *m_editorWidget; + TextEditorWidget *m_editorWidget; QList<QuickFixAssistProvider *> m_quickFixProviders; Internal::ProcessorRunner *m_requestRunner; IAssistProvider *m_requestProvider; @@ -140,7 +140,7 @@ CodeAssistantPrivate::CodeAssistantPrivate(CodeAssistant *assistant) this, &CodeAssistantPrivate::clearAbortedPosition); } -void CodeAssistantPrivate::configure(BaseTextEditorWidget *editorWidget) +void CodeAssistantPrivate::configure(TextEditorWidget *editorWidget) { // @TODO: There's a list of providers but currently only the first one is used. Perhaps we // should implement a truly mechanism to support multiple providers for an editor (either @@ -514,7 +514,7 @@ CodeAssistant::~CodeAssistant() delete d; } -void CodeAssistant::configure(BaseTextEditorWidget *editorWidget) +void CodeAssistant::configure(TextEditorWidget *editorWidget) { d->configure(editorWidget); } diff --git a/src/plugins/texteditor/codeassist/codeassistant.h b/src/plugins/texteditor/codeassist/codeassistant.h index 0bfc5fa68cf..a984ce67999 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.h +++ b/src/plugins/texteditor/codeassist/codeassistant.h @@ -40,7 +40,7 @@ namespace TextEditor { class CodeAssistantPrivate; class IAssistProvider; -class BaseTextEditorWidget; +class TextEditorWidget; class CodeAssistant : public QObject { @@ -50,7 +50,7 @@ public: CodeAssistant(); ~CodeAssistant(); - void configure(BaseTextEditorWidget *editorWidget); + void configure(TextEditorWidget *editorWidget); void process(); void notifyChange(); diff --git a/src/plugins/texteditor/codeassist/functionhintproposal.cpp b/src/plugins/texteditor/codeassist/functionhintproposal.cpp index 7c09928a14a..a6cd669bb48 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposal.cpp +++ b/src/plugins/texteditor/codeassist/functionhintproposal.cpp @@ -56,7 +56,7 @@ bool FunctionHintProposal::isCorrective() const return false; } -void FunctionHintProposal::makeCorrection(BaseTextEditorWidget *) +void FunctionHintProposal::makeCorrection(TextEditorWidget *) {} IAssistProposalModel *FunctionHintProposal::model() const diff --git a/src/plugins/texteditor/codeassist/functionhintproposal.h b/src/plugins/texteditor/codeassist/functionhintproposal.h index b83f753a736..955459498ed 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposal.h +++ b/src/plugins/texteditor/codeassist/functionhintproposal.h @@ -46,7 +46,7 @@ public: bool isFragile() const Q_DECL_OVERRIDE; int basePosition() const Q_DECL_OVERRIDE; bool isCorrective() const Q_DECL_OVERRIDE; - void makeCorrection(BaseTextEditorWidget *editorWidget) Q_DECL_OVERRIDE; + void makeCorrection(TextEditorWidget *editorWidget) Q_DECL_OVERRIDE; IAssistProposalModel *model() const Q_DECL_OVERRIDE; IAssistProposalWidget *createWidget() const Q_DECL_OVERRIDE; diff --git a/src/plugins/texteditor/codeassist/genericproposal.cpp b/src/plugins/texteditor/codeassist/genericproposal.cpp index 2b138b3394b..c9612c2c4aa 100644 --- a/src/plugins/texteditor/codeassist/genericproposal.cpp +++ b/src/plugins/texteditor/codeassist/genericproposal.cpp @@ -63,7 +63,7 @@ bool GenericProposal::isCorrective() const return false; } -void GenericProposal::makeCorrection(BaseTextEditorWidget *) +void GenericProposal::makeCorrection(TextEditorWidget *) {} IAssistProposalModel *GenericProposal::model() const diff --git a/src/plugins/texteditor/codeassist/genericproposal.h b/src/plugins/texteditor/codeassist/genericproposal.h index bc7bd557d64..d1c27fc9783 100644 --- a/src/plugins/texteditor/codeassist/genericproposal.h +++ b/src/plugins/texteditor/codeassist/genericproposal.h @@ -48,7 +48,7 @@ public: bool isFragile() const Q_DECL_OVERRIDE; int basePosition() const Q_DECL_OVERRIDE; bool isCorrective() const Q_DECL_OVERRIDE; - void makeCorrection(BaseTextEditorWidget *editorWidget) Q_DECL_OVERRIDE; + void makeCorrection(TextEditorWidget *editorWidget) Q_DECL_OVERRIDE; IAssistProposalModel *model() const Q_DECL_OVERRIDE; IAssistProposalWidget *createWidget() const Q_DECL_OVERRIDE; diff --git a/src/plugins/texteditor/codeassist/iassistproposal.h b/src/plugins/texteditor/codeassist/iassistproposal.h index 2bf6f8379d8..f22b9ec7a84 100644 --- a/src/plugins/texteditor/codeassist/iassistproposal.h +++ b/src/plugins/texteditor/codeassist/iassistproposal.h @@ -36,7 +36,7 @@ namespace TextEditor { class IAssistProposalModel; class IAssistProposalWidget; -class BaseTextEditorWidget; +class TextEditorWidget; class TEXTEDITOR_EXPORT IAssistProposal { @@ -47,7 +47,7 @@ public: virtual bool isFragile() const = 0; virtual int basePosition() const = 0; virtual bool isCorrective() const = 0; - virtual void makeCorrection(BaseTextEditorWidget *editorWidget) = 0; + virtual void makeCorrection(TextEditorWidget *editorWidget) = 0; virtual IAssistProposalModel *model() const = 0; virtual IAssistProposalWidget *createWidget() const = 0; }; diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp index 1b16b7b8480..2c4720d5801 100644 --- a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp +++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp @@ -96,7 +96,7 @@ bool KeywordsAssistProposalItem::prematurelyApplies(const QChar &c) const return c == QLatin1Char('(') && m_isFunction; } -void KeywordsAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, +void KeywordsAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const { const CompletionSettings &settings = TextEditorSettings::completionSettings(); diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.h b/src/plugins/texteditor/codeassist/keywordscompletionassist.h index 243be1fdb8e..d86bcddab73 100644 --- a/src/plugins/texteditor/codeassist/keywordscompletionassist.h +++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.h @@ -62,7 +62,7 @@ public: ~KeywordsAssistProposalItem(); bool prematurelyApplies(const QChar &c) const Q_DECL_OVERRIDE; - void applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const Q_DECL_OVERRIDE; + void applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const Q_DECL_OVERRIDE; private: bool m_isFunction; }; diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index e877dcb06a6..a5b15488910 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -46,7 +46,7 @@ namespace TextEditor { static PlainTextEditorFactory *m_instance = 0; -class PlainTextEditorWidget : public BaseTextEditorWidget +class PlainTextEditorWidget : public TextEditorWidget { public: PlainTextEditorWidget() {} diff --git a/src/plugins/texteditor/plaintexteditorfactory.h b/src/plugins/texteditor/plaintexteditorfactory.h index 2d9ef20a2e4..c9ee5c72f28 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.h +++ b/src/plugins/texteditor/plaintexteditorfactory.h @@ -34,7 +34,7 @@ namespace TextEditor { -class TEXTEDITOR_EXPORT PlainTextEditorFactory : public TextEditor::BaseTextEditorFactory +class TEXTEDITOR_EXPORT PlainTextEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index d3fe3972060..4e4681440ab 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -122,7 +122,7 @@ bool RefactoringChanges::removeFile(const QString &fileName) const return true; } -BaseTextEditorWidget *RefactoringChanges::openEditor(const QString &fileName, bool activate, int line, int column) +TextEditorWidget *RefactoringChanges::openEditor(const QString &fileName, bool activate, int line, int column) { EditorManager::OpenEditorFlags flags = EditorManager::IgnoreNavigationHistory; if (!activate) @@ -134,12 +134,12 @@ BaseTextEditorWidget *RefactoringChanges::openEditor(const QString &fileName, bo IEditor *editor = EditorManager::openEditorAt(fileName, line, column, Id(), flags); if (editor) - return qobject_cast<BaseTextEditorWidget *>(editor->widget()); + return qobject_cast<TextEditorWidget *>(editor->widget()); else return 0; } -RefactoringFilePtr RefactoringChanges::file(BaseTextEditorWidget *editor) +RefactoringFilePtr RefactoringChanges::file(TextEditorWidget *editor) { return RefactoringFilePtr(new RefactoringFile(editor)); } @@ -159,7 +159,7 @@ RefactoringFile::RefactoringFile(QTextDocument *document, const QString &fileNam , m_appliedOnce(false) { } -RefactoringFile::RefactoringFile(BaseTextEditorWidget *editor) +RefactoringFile::RefactoringFile(TextEditorWidget *editor) : m_fileName(editor->textDocument()->filePath()) , m_document(0) , m_editor(editor) @@ -181,7 +181,7 @@ RefactoringFile::RefactoringFile(const QString &fileName, const QSharedPointer<R { QList<IEditor *> editors = DocumentModel::editorsForFilePath(fileName); if (!editors.isEmpty()) - m_editor = qobject_cast<BaseTextEditorWidget *>(editors.first()->widget()); + m_editor = qobject_cast<TextEditorWidget *>(editors.first()->widget()); } RefactoringFile::~RefactoringFile() @@ -242,7 +242,7 @@ QString RefactoringFile::fileName() const return m_fileName; } -BaseTextEditorWidget *RefactoringFile::editor() const +TextEditorWidget *RefactoringFile::editor() const { return m_editor; } diff --git a/src/plugins/texteditor/refactoringchanges.h b/src/plugins/texteditor/refactoringchanges.h index af42647d0c0..c2462be7a32 100644 --- a/src/plugins/texteditor/refactoringchanges.h +++ b/src/plugins/texteditor/refactoringchanges.h @@ -45,7 +45,7 @@ QT_END_NAMESPACE namespace TextEditor { class TextDocument; -class BaseTextEditorWidget; +class TextEditorWidget; class RefactoringChanges; class RefactoringFile; class RefactoringChangesData; @@ -68,7 +68,7 @@ public: // mustn't use the cursor to change the document const QTextCursor cursor() const; QString fileName() const; - BaseTextEditorWidget *editor() const; + TextEditorWidget *editor() const; // converts 1-based line and column into 0-based source offset int position(unsigned line, unsigned column) const; @@ -90,7 +90,7 @@ protected: // this constructor, because it can't be used to apply changes RefactoringFile(QTextDocument *document, const QString &fileName); - RefactoringFile(BaseTextEditorWidget *editor); + RefactoringFile(TextEditorWidget *editor); RefactoringFile(const QString &fileName, const QSharedPointer<RefactoringChangesData> &data); QTextDocument *mutableDocument() const; @@ -107,7 +107,7 @@ protected: QSharedPointer<RefactoringChangesData> m_data; mutable Utils::TextFileFormat m_textFileFormat; mutable QTextDocument *m_document; - BaseTextEditorWidget *m_editor; + TextEditorWidget *m_editor; Utils::ChangeSet m_changes; QList<Range> m_indentRanges; QList<Range> m_reindentRanges; @@ -132,7 +132,7 @@ public: RefactoringChanges(); virtual ~RefactoringChanges(); - static RefactoringFilePtr file(BaseTextEditorWidget *editor); + static RefactoringFilePtr file(TextEditorWidget *editor); RefactoringFilePtr file(const QString &fileName) const; bool createFile(const QString &fileName, const QString &contents, bool reindent = true, bool openEditor = true) const; bool removeFile(const QString &fileName) const; @@ -140,7 +140,7 @@ public: protected: explicit RefactoringChanges(RefactoringChangesData *data); - static BaseTextEditorWidget *openEditor(const QString &fileName, bool activate, int line, int column); + static TextEditorWidget *openEditor(const QString &fileName, bool activate, int line, int column); static RefactoringSelections rangesToSelections(QTextDocument *document, const QList<Range> &ranges); protected: diff --git a/src/plugins/texteditor/refactoroverlay.cpp b/src/plugins/texteditor/refactoroverlay.cpp index 64dd458b27b..19ea5fa0085 100644 --- a/src/plugins/texteditor/refactoroverlay.cpp +++ b/src/plugins/texteditor/refactoroverlay.cpp @@ -37,7 +37,7 @@ namespace TextEditor { -RefactorOverlay::RefactorOverlay(TextEditor::BaseTextEditorWidget *editor) : +RefactorOverlay::RefactorOverlay(TextEditor::TextEditorWidget *editor) : QObject(editor), m_editor(editor), m_maxWidth(0), diff --git a/src/plugins/texteditor/refactoroverlay.h b/src/plugins/texteditor/refactoroverlay.h index b4e6aaabe7a..1dc52aaf0b1 100644 --- a/src/plugins/texteditor/refactoroverlay.h +++ b/src/plugins/texteditor/refactoroverlay.h @@ -36,7 +36,7 @@ #include <QIcon> namespace TextEditor { -class BaseTextEditorWidget; +class TextEditorWidget; struct TEXTEDITOR_EXPORT RefactorMarker { inline bool isValid() const { return !cursor.isNull(); } @@ -53,7 +53,7 @@ class TEXTEDITOR_EXPORT RefactorOverlay : public QObject { Q_OBJECT public: - explicit RefactorOverlay(TextEditor::BaseTextEditorWidget *editor); + explicit RefactorOverlay(TextEditor::TextEditorWidget *editor); bool isEmpty() const { return m_markers.isEmpty(); } void paint(QPainter *painter, const QRect &clip); @@ -68,7 +68,7 @@ public: private: void paintMarker(const RefactorMarker& marker, QPainter *painter, const QRect &clip); RefactorMarkers m_markers; - BaseTextEditorWidget *m_editor; + TextEditorWidget *m_editor; int m_maxWidth; const QIcon m_icon; }; diff --git a/src/plugins/texteditor/snippets/snippeteditor.cpp b/src/plugins/texteditor/snippets/snippeteditor.cpp index 42216125d44..323f26e672c 100644 --- a/src/plugins/texteditor/snippets/snippeteditor.cpp +++ b/src/plugins/texteditor/snippets/snippeteditor.cpp @@ -47,7 +47,7 @@ namespace TextEditor { SnippetEditorWidget::SnippetEditorWidget(QWidget *parent) - : BaseTextEditorWidget(parent) + : TextEditorWidget(parent) { setupFallBackEditor(TextEditor::Constants::SNIPPET_EDITOR_ID); setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); @@ -62,7 +62,7 @@ void SnippetEditorWidget::focusOutEvent(QFocusEvent *event) document()->setModified(false); emit snippetContentChanged(); } - BaseTextEditorWidget::focusOutEvent(event); + TextEditorWidget::focusOutEvent(event); } } // namespace diff --git a/src/plugins/texteditor/snippets/snippeteditor.h b/src/plugins/texteditor/snippets/snippeteditor.h index 51701b84ddc..a995267559b 100644 --- a/src/plugins/texteditor/snippets/snippeteditor.h +++ b/src/plugins/texteditor/snippets/snippeteditor.h @@ -35,7 +35,7 @@ namespace TextEditor { -class TEXTEDITOR_EXPORT SnippetEditorWidget : public BaseTextEditorWidget +class TEXTEDITOR_EXPORT SnippetEditorWidget : public TextEditorWidget { Q_OBJECT diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index c72b16329fa..4ae5f202424 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -421,7 +421,7 @@ bool TextDocument::save(QString *errorString, const QString &saveFileName, bool QTextCursor cursor(&d->m_document); // When autosaving, we don't want to modify the document/location under the user's fingers. - BaseTextEditorWidget *editorWidget = 0; + TextEditorWidget *editorWidget = 0; int savedPosition = 0; int savedAnchor = 0; int savedVScrollBarValue = 0; @@ -618,7 +618,7 @@ bool TextDocument::reload(QString *errorString) bool TextDocument::setPlainText(const QString &text) { if (text.size() > EditorManager::maxTextFileSize()) { - document()->setPlainText(BaseTextEditorWidget::msgTextTooLarge(text.size())); + document()->setPlainText(TextEditorWidget::msgTextTooLarge(text.size())); d->resetRevisions(); document()->setModified(false); return false; diff --git a/src/plugins/texteditor/textdocument.h b/src/plugins/texteditor/textdocument.h index 55ba1539829..de3b3a0edbf 100644 --- a/src/plugins/texteditor/textdocument.h +++ b/src/plugins/texteditor/textdocument.h @@ -149,7 +149,7 @@ private: TextDocumentPrivate *d; }; -typedef QSharedPointer<TextDocument> BaseTextDocumentPtr; +typedef QSharedPointer<TextDocument> TextDocumentPtr; } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index f91c8ad8d26..5d171467244 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -145,12 +145,12 @@ static QString QString_toLower(const QString &str) return str.toLower(); } -class BaseTextEditorAnimator : public QObject +class TextEditorAnimator : public QObject { Q_OBJECT public: - BaseTextEditorAnimator(QObject *parent); + TextEditorAnimator(QObject *parent); inline void setPosition(int position) { m_position = position; } inline int position() const { return m_position; } @@ -186,7 +186,7 @@ private: class TextEditExtraArea : public QWidget { public: - TextEditExtraArea(BaseTextEditorWidget *edit) + TextEditExtraArea(TextEditorWidget *edit) : QWidget(edit) { textEdit = edit; @@ -221,7 +221,7 @@ protected: } private: - BaseTextEditorWidget *textEdit; + TextEditorWidget *textEdit; }; class BaseTextEditorPrivate @@ -229,14 +229,14 @@ class BaseTextEditorPrivate public: BaseTextEditorPrivate() {} - QPointer<BaseTextEditorFactory> m_origin; + QPointer<TextEditorFactory> m_origin; }; -class BaseTextEditorWidgetPrivate : public QObject +class TextEditorWidgetPrivate : public QObject { public: - BaseTextEditorWidgetPrivate(BaseTextEditorWidget *parent); - ~BaseTextEditorWidgetPrivate() + TextEditorWidgetPrivate(TextEditorWidget *parent); + ~TextEditorWidgetPrivate() { delete m_toolBar; } @@ -271,7 +271,7 @@ public: QTextBlock foldedBlockAt(const QPoint &pos, QRect *box = 0) const; void updateLink(QMouseEvent *e); - void showLink(const BaseTextEditorWidget::Link &); + void showLink(const TextEditorWidget::Link &); void clearLink(); void universalHelper(); // test function for development @@ -312,7 +312,7 @@ public: void reconfigure(); public: - BaseTextEditorWidget *q; + TextEditorWidget *q; QToolBar *m_toolBar; QWidget *m_stretchWidget; LineColumnLabel *m_cursorPositionLabel; @@ -377,7 +377,7 @@ public: uint m_maybeFakeTooltipEvent : 1; int m_visibleWrapColumn; - BaseTextEditorWidget::Link m_currentLink; + TextEditorWidget::Link m_currentLink; bool m_linkPressed; QRegExp m_searchExpr; @@ -385,7 +385,7 @@ public: void highlightSearchResults(const QTextBlock &block, TextEditorOverlay *overlay); QTimer m_delayedUpdateTimer; - QList<QTextEdit::ExtraSelection> m_extraSelections[BaseTextEditorWidget::NExtraSelectionKinds]; + QList<QTextEdit::ExtraSelection> m_extraSelections[TextEditorWidget::NExtraSelectionKinds]; // block selection mode bool m_inBlockSelectionMode; @@ -410,18 +410,18 @@ public: QTextCursor m_selectBlockAnchor; - Internal::BaseTextBlockSelection m_blockSelection; + Internal::TextBlockSelection m_blockSelection; void moveCursorVisible(bool ensureVisible = true); int visualIndent(const QTextBlock &block) const; - BaseTextEditorPrivateHighlightBlocks m_highlightBlocksInfo; + TextEditorPrivateHighlightBlocks m_highlightBlocksInfo; QTimer m_highlightBlocksTimer; CodeAssistant m_codeAssistant; bool m_assistRelevantContentAdded; - QPointer<BaseTextEditorAnimator> m_animator; + QPointer<TextEditorAnimator> m_animator; int m_cursorBlockNumber; int m_blockCount; @@ -437,7 +437,7 @@ public: CompletionAssistProvider *m_completionAssistProvider; }; -BaseTextEditorWidgetPrivate::BaseTextEditorWidgetPrivate(BaseTextEditorWidget *parent) +TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) : q(parent), m_toolBar(0), m_stretchWidget(0), @@ -492,9 +492,9 @@ BaseTextEditorWidgetPrivate::BaseTextEditorWidgetPrivate(BaseTextEditorWidget *p Aggregation::Aggregate *aggregate = new Aggregation::Aggregate; BaseTextFind *baseTextFind = new BaseTextFind(q); connect(baseTextFind, &BaseTextFind::highlightAllRequested, - this, &BaseTextEditorWidgetPrivate::highlightSearchResultsSlot); + this, &TextEditorWidgetPrivate::highlightSearchResultsSlot); connect(baseTextFind, &BaseTextFind::findScopeChanged, - this, &BaseTextEditorWidgetPrivate::setFindScope); + this, &TextEditorWidgetPrivate::setFindScope); aggregate->add(baseTextFind); aggregate->add(q); @@ -526,7 +526,7 @@ using namespace Internal; * Test if syntax highlighter is available (or unneeded) for \a widget. * If not found, show a warning with a link to the relevant settings page. */ -static void updateEditorInfoBar(BaseTextEditorWidget *widget) +static void updateEditorInfoBar(TextEditorWidget *widget) { Id infoSyntaxDefinition(Constants::INFO_SYNTAX_DEFINITION); InfoBar *infoBar = widget->textDocument()->infoBar(); @@ -547,14 +547,14 @@ static void updateEditorInfoBar(BaseTextEditorWidget *widget) } } -QString BaseTextEditorWidget::plainTextFromSelection(const QTextCursor &cursor) const +QString TextEditorWidget::plainTextFromSelection(const QTextCursor &cursor) const { // Copy the selected text as plain text QString text = cursor.selectedText(); return convertToPlainText(text); } -QString BaseTextEditorWidget::convertToPlainText(const QString &txt) +QString TextEditorWidget::convertToPlainText(const QString &txt) { QString ret = txt; QChar *uc = ret.data(); @@ -580,21 +580,21 @@ QString BaseTextEditorWidget::convertToPlainText(const QString &txt) static const char kTextBlockMimeType[] = "application/vnd.qtcreator.blocktext"; -BaseTextEditorWidget::BaseTextEditorWidget(QWidget *parent) +TextEditorWidget::TextEditorWidget(QWidget *parent) : QPlainTextEdit(parent) { // "Needed", as the creation below triggers ChildEvents that are // passed to this object's event() which uses 'd'. d = 0; - d = new BaseTextEditorWidgetPrivate(this); + d = new TextEditorWidgetPrivate(this); } -void BaseTextEditorWidget::setTextDocument(const QSharedPointer<TextDocument> &doc) +void TextEditorWidget::setTextDocument(const QSharedPointer<TextDocument> &doc) { d->ctor(doc); } -void BaseTextEditorWidgetPrivate::ctor(const QSharedPointer<TextDocument> &doc) +void TextEditorWidgetPrivate::ctor(const QSharedPointer<TextDocument> &doc) { q->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); @@ -618,25 +618,25 @@ void BaseTextEditorWidgetPrivate::ctor(const QSharedPointer<TextDocument> &doc) suggestedVisibleFoldedBlockNumber = -1; QObject::connect(&m_codeAssistant, &CodeAssistant::finished, - q, &BaseTextEditorWidget::assistFinished); + q, &TextEditorWidget::assistFinished); QObject::connect(q, &QPlainTextEdit::blockCountChanged, - this, &BaseTextEditorWidgetPrivate::slotUpdateExtraAreaWidth); + this, &TextEditorWidgetPrivate::slotUpdateExtraAreaWidth); QObject::connect(q, &QPlainTextEdit::modificationChanged, m_extraArea, static_cast<void (QWidget::*)()>(&QWidget::update)); QObject::connect(q, &QPlainTextEdit::cursorPositionChanged, - q, &BaseTextEditorWidget::slotCursorPositionChanged); + q, &TextEditorWidget::slotCursorPositionChanged); QObject::connect(q, &QPlainTextEdit::cursorPositionChanged, - this, &BaseTextEditorWidgetPrivate::updateCursorPosition); + this, &TextEditorWidgetPrivate::updateCursorPosition); QObject::connect(q, &QPlainTextEdit::updateRequest, - this, &BaseTextEditorWidgetPrivate::slotUpdateRequest); + this, &TextEditorWidgetPrivate::slotUpdateRequest); QObject::connect(q, &QPlainTextEdit::selectionChanged, - this, &BaseTextEditorWidgetPrivate::slotSelectionChanged); + this, &TextEditorWidgetPrivate::slotSelectionChanged); // (void) new QShortcut(tr("CTRL+L"), this, SLOT(centerCursor()), 0, Qt::WidgetShortcut); // (void) new QShortcut(tr("F9"), this, SLOT(slotToggleMark()), 0, Qt::WidgetShortcut); @@ -652,11 +652,11 @@ void BaseTextEditorWidgetPrivate::ctor(const QSharedPointer<TextDocument> &doc) ? Qt::darkMagenta : Qt::magenta); m_parenthesesMatchingTimer.setSingleShot(true); QObject::connect(&m_parenthesesMatchingTimer, &QTimer::timeout, - this, &BaseTextEditorWidgetPrivate::_q_matchParentheses); + this, &TextEditorWidgetPrivate::_q_matchParentheses); m_highlightBlocksTimer.setSingleShot(true); QObject::connect(&m_highlightBlocksTimer, &QTimer::timeout, - this, &BaseTextEditorWidgetPrivate::_q_highlightBlocks); + this, &TextEditorWidgetPrivate::_q_highlightBlocks); m_animator = 0; @@ -671,13 +671,13 @@ void BaseTextEditorWidgetPrivate::ctor(const QSharedPointer<TextDocument> &doc) m_moveLineUndoHack = false; } -BaseTextEditorWidget::~BaseTextEditorWidget() +TextEditorWidget::~TextEditorWidget() { delete d; d = 0; } -void BaseTextEditorWidget::print(QPrinter *printer) +void TextEditorWidget::print(QPrinter *printer) { const bool oldFullPage = printer->fullPage(); printer->setFullPage(true); @@ -731,7 +731,7 @@ static void printPage(int index, QPainter *painter, const QTextDocument *doc, painter->restore(); } -void BaseTextEditorWidgetPrivate::print(QPrinter *printer) +void TextEditorWidgetPrivate::print(QPrinter *printer) { QTextDocument *doc = q->document(); @@ -868,7 +868,7 @@ UserCanceled: } -int BaseTextEditorWidgetPrivate::visualIndent(const QTextBlock &block) const +int TextEditorWidgetPrivate::visualIndent(const QTextBlock &block) const { if (!block.isValid()) return 0; @@ -886,7 +886,7 @@ int BaseTextEditorWidgetPrivate::visualIndent(const QTextBlock &block) const return 0; } -void BaseTextEditorWidget::selectEncoding() +void TextEditorWidget::selectEncoding() { TextDocument *doc = d->m_document.data(); CodecSelector codecSelector(this, doc); @@ -909,19 +909,19 @@ void BaseTextEditorWidget::selectEncoding() } } -void BaseTextEditorWidget::updateTextCodecLabel() +void TextEditorWidget::updateTextCodecLabel() { QString text = QString::fromLatin1(d->m_document->codec()->name()); d->m_fileEncodingLabel->setText(text, text); } -QString BaseTextEditorWidget::msgTextTooLarge(quint64 size) +QString TextEditorWidget::msgTextTooLarge(quint64 size) { return tr("The text is too large to be displayed (%1 MB)."). arg(size >> 20); } -void BaseTextEditorWidget::insertPlainText(const QString &text) +void TextEditorWidget::insertPlainText(const QString &text) { if (d->m_inBlockSelectionMode) d->insertIntoBlockSelection(text); @@ -929,7 +929,7 @@ void BaseTextEditorWidget::insertPlainText(const QString &text) QPlainTextEdit::insertPlainText(text); } -QString BaseTextEditorWidget::selectedText() const +QString TextEditorWidget::selectedText() const { if (d->m_inBlockSelectionMode) return d->copyBlockSelection(); @@ -937,7 +937,7 @@ QString BaseTextEditorWidget::selectedText() const return textCursor().selectedText(); } -void BaseTextEditorWidgetPrivate::updateCannotDecodeInfo() +void TextEditorWidgetPrivate::updateCannotDecodeInfo() { q->setReadOnly(m_document->hasDecodingError()); InfoBar *infoBar = m_document->infoBar(); @@ -946,25 +946,25 @@ void BaseTextEditorWidgetPrivate::updateCannotDecodeInfo() if (!infoBar->canInfoBeAdded(selectEncodingId)) return; InfoBarEntry info(selectEncodingId, - BaseTextEditorWidget::tr("<b>Error:</b> Could not decode \"%1\" with \"%2\"-encoding. Editing not possible.") + TextEditorWidget::tr("<b>Error:</b> Could not decode \"%1\" with \"%2\"-encoding. Editing not possible.") .arg(m_document->displayName()).arg(QString::fromLatin1(m_document->codec()->name()))); - info.setCustomButtonInfo(BaseTextEditorWidget::tr("Select Encoding"), [this]() { q->selectEncoding(); }); + info.setCustomButtonInfo(TextEditorWidget::tr("Select Encoding"), [this]() { q->selectEncoding(); }); infoBar->addInfo(info); } else { infoBar->removeInfo(selectEncodingId); } } -bool BaseTextEditorWidget::open(QString *errorString, const QString &fileName, const QString &realFileName) +bool TextEditorWidget::open(QString *errorString, const QString &fileName, const QString &realFileName) { if (d->m_document->open(errorString, fileName, realFileName)) { moveCursor(QTextCursor::Start); d->updateCannotDecodeInfo(); if (d->m_fileEncodingLabel) { connect(d->m_fileEncodingLabel, &LineColumnLabel::clicked, - this, &BaseTextEditorWidget::selectEncoding, Qt::UniqueConnection); + this, &TextEditorWidget::selectEncoding, Qt::UniqueConnection); connect(d->m_document->document(), &QTextDocument::modificationChanged, - this, &BaseTextEditorWidget::updateTextCodecLabel, Qt::UniqueConnection); + this, &TextEditorWidget::updateTextCodecLabel, Qt::UniqueConnection); updateTextCodecLabel(); } return true; @@ -975,7 +975,7 @@ bool BaseTextEditorWidget::open(QString *errorString, const QString &fileName, c /* Collapses the first comment in a file, if there is only whitespace above */ -void BaseTextEditorWidgetPrivate::foldLicenseHeader() +void TextEditorWidgetPrivate::foldLicenseHeader() { QTextDocument *doc = q->document(); TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); @@ -998,17 +998,17 @@ void BaseTextEditorWidgetPrivate::foldLicenseHeader() } } -TextDocument *BaseTextEditorWidget::textDocument() const +TextDocument *TextEditorWidget::textDocument() const { return d->m_document.data(); } -BaseTextDocumentPtr BaseTextEditorWidget::textDocumentPtr() const +TextDocumentPtr TextEditorWidget::textDocumentPtr() const { return d->m_document; } -void BaseTextEditorWidgetPrivate::editorContentsChange(int position, int charsRemoved, int charsAdded) +void TextEditorWidgetPrivate::editorContentsChange(int position, int charsRemoved, int charsAdded) { if (m_animator) m_animator->finish(); @@ -1051,7 +1051,7 @@ void BaseTextEditorWidgetPrivate::editorContentsChange(int position, int charsRe m_blockCount = newBlockCount; } -void BaseTextEditorWidgetPrivate::slotSelectionChanged() +void TextEditorWidgetPrivate::slotSelectionChanged() { if (!q->textCursor().hasSelection() && !m_selectBlockAnchor.isNull()) m_selectBlockAnchor = QTextCursor(); @@ -1059,7 +1059,7 @@ void BaseTextEditorWidgetPrivate::slotSelectionChanged() clearLink(); } -void BaseTextEditorWidget::gotoBlockStart() +void TextEditorWidget::gotoBlockStart() { QTextCursor cursor = textCursor(); if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, false)) { @@ -1068,7 +1068,7 @@ void BaseTextEditorWidget::gotoBlockStart() } } -void BaseTextEditorWidget::gotoBlockEnd() +void TextEditorWidget::gotoBlockEnd() { QTextCursor cursor = textCursor(); if (TextBlockUserData::findNextClosingParenthesis(&cursor, false)) { @@ -1077,7 +1077,7 @@ void BaseTextEditorWidget::gotoBlockEnd() } } -void BaseTextEditorWidget::gotoBlockStartWithSelection() +void TextEditorWidget::gotoBlockStartWithSelection() { QTextCursor cursor = textCursor(); if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, true)) { @@ -1086,7 +1086,7 @@ void BaseTextEditorWidget::gotoBlockStartWithSelection() } } -void BaseTextEditorWidget::gotoBlockEndWithSelection() +void TextEditorWidget::gotoBlockEndWithSelection() { QTextCursor cursor = textCursor(); if (TextBlockUserData::findNextClosingParenthesis(&cursor, true)) { @@ -1095,112 +1095,112 @@ void BaseTextEditorWidget::gotoBlockEndWithSelection() } } -void BaseTextEditorWidget::gotoLineStart() +void TextEditorWidget::gotoLineStart() { d->handleHomeKey(false); } -void BaseTextEditorWidget::gotoLineStartWithSelection() +void TextEditorWidget::gotoLineStartWithSelection() { d->handleHomeKey(true); } -void BaseTextEditorWidget::gotoLineEnd() +void TextEditorWidget::gotoLineEnd() { moveCursor(QTextCursor::EndOfLine); } -void BaseTextEditorWidget::gotoLineEndWithSelection() +void TextEditorWidget::gotoLineEndWithSelection() { moveCursor(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); } -void BaseTextEditorWidget::gotoNextLine() +void TextEditorWidget::gotoNextLine() { moveCursor(QTextCursor::Down); } -void BaseTextEditorWidget::gotoNextLineWithSelection() +void TextEditorWidget::gotoNextLineWithSelection() { moveCursor(QTextCursor::Down, QTextCursor::KeepAnchor); } -void BaseTextEditorWidget::gotoPreviousLine() +void TextEditorWidget::gotoPreviousLine() { moveCursor(QTextCursor::Up); } -void BaseTextEditorWidget::gotoPreviousLineWithSelection() +void TextEditorWidget::gotoPreviousLineWithSelection() { moveCursor(QTextCursor::Up, QTextCursor::KeepAnchor); } -void BaseTextEditorWidget::gotoPreviousCharacter() +void TextEditorWidget::gotoPreviousCharacter() { moveCursor(QTextCursor::PreviousCharacter); } -void BaseTextEditorWidget::gotoPreviousCharacterWithSelection() +void TextEditorWidget::gotoPreviousCharacterWithSelection() { moveCursor(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); } -void BaseTextEditorWidget::gotoNextCharacter() +void TextEditorWidget::gotoNextCharacter() { moveCursor(QTextCursor::NextCharacter); } -void BaseTextEditorWidget::gotoNextCharacterWithSelection() +void TextEditorWidget::gotoNextCharacterWithSelection() { moveCursor(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); } -void BaseTextEditorWidget::gotoPreviousWord() +void TextEditorWidget::gotoPreviousWord() { moveCursor(QTextCursor::PreviousWord); setTextCursor(textCursor()); } -void BaseTextEditorWidget::gotoPreviousWordWithSelection() +void TextEditorWidget::gotoPreviousWordWithSelection() { moveCursor(QTextCursor::PreviousWord, QTextCursor::KeepAnchor); setTextCursor(textCursor()); } -void BaseTextEditorWidget::gotoNextWord() +void TextEditorWidget::gotoNextWord() { moveCursor(QTextCursor::NextWord); setTextCursor(textCursor()); } -void BaseTextEditorWidget::gotoNextWordWithSelection() +void TextEditorWidget::gotoNextWordWithSelection() { moveCursor(QTextCursor::NextWord, QTextCursor::KeepAnchor); setTextCursor(textCursor()); } -void BaseTextEditorWidget::gotoPreviousWordCamelCase() +void TextEditorWidget::gotoPreviousWordCamelCase() { QTextCursor c = textCursor(); d->camelCaseLeft(c, QTextCursor::MoveAnchor); setTextCursor(c); } -void BaseTextEditorWidget::gotoPreviousWordCamelCaseWithSelection() +void TextEditorWidget::gotoPreviousWordCamelCaseWithSelection() { QTextCursor c = textCursor(); d->camelCaseLeft(c, QTextCursor::KeepAnchor); setTextCursor(c); } -void BaseTextEditorWidget::gotoNextWordCamelCase() +void TextEditorWidget::gotoNextWordCamelCase() { QTextCursor c = textCursor(); d->camelCaseRight(c, QTextCursor::MoveAnchor); setTextCursor(c); } -void BaseTextEditorWidget::gotoNextWordCamelCaseWithSelection() +void TextEditorWidget::gotoNextWordCamelCaseWithSelection() { QTextCursor c = textCursor(); d->camelCaseRight(c, QTextCursor::KeepAnchor); @@ -1215,7 +1215,7 @@ static QTextCursor flippedCursor(const QTextCursor &cursor) return flipped; } -bool BaseTextEditorWidget::selectBlockUp() +bool TextEditorWidget::selectBlockUp() { QTextCursor cursor = textCursor(); if (!cursor.hasSelection()) @@ -1233,7 +1233,7 @@ bool BaseTextEditorWidget::selectBlockUp() return true; } -bool BaseTextEditorWidget::selectBlockDown() +bool TextEditorWidget::selectBlockDown() { QTextCursor tc = textCursor(); QTextCursor cursor = d->m_selectBlockAnchor; @@ -1258,18 +1258,18 @@ bool BaseTextEditorWidget::selectBlockDown() return true; } -void BaseTextEditorWidget::copyLineUp() +void TextEditorWidget::copyLineUp() { d->copyLineUpDown(true); } -void BaseTextEditorWidget::copyLineDown() +void TextEditorWidget::copyLineDown() { d->copyLineUpDown(false); } // @todo: Potential reuse of some code around the following functions... -void BaseTextEditorWidgetPrivate::copyLineUpDown(bool up) +void TextEditorWidgetPrivate::copyLineUpDown(bool up) { QTextCursor cursor = q->textCursor(); QTextCursor move = cursor; @@ -1320,7 +1320,7 @@ void BaseTextEditorWidgetPrivate::copyLineUpDown(bool up) q->setTextCursor(move); } -void BaseTextEditorWidget::joinLines() +void TextEditorWidget::joinLines() { QTextCursor cursor = textCursor(); QTextCursor start = cursor; @@ -1354,7 +1354,7 @@ void BaseTextEditorWidget::joinLines() setTextCursor(cursor); } -void BaseTextEditorWidget::insertLineAbove() +void TextEditorWidget::insertLineAbove() { QTextCursor cursor = textCursor(); cursor.beginEditBlock(); @@ -1368,7 +1368,7 @@ void BaseTextEditorWidget::insertLineAbove() setTextCursor(cursor); } -void BaseTextEditorWidget::insertLineBelow() +void TextEditorWidget::insertLineBelow() { if (d->m_inBlockSelectionMode) d->disableBlockSelection(false); @@ -1381,70 +1381,70 @@ void BaseTextEditorWidget::insertLineBelow() setTextCursor(cursor); } -void BaseTextEditorWidget::moveLineUp() +void TextEditorWidget::moveLineUp() { d->moveLineUpDown(true); } -void BaseTextEditorWidget::moveLineDown() +void TextEditorWidget::moveLineDown() { d->moveLineUpDown(false); } -void BaseTextEditorWidget::uppercaseSelection() +void TextEditorWidget::uppercaseSelection() { d->transformSelection(&QString_toUpper); } -void BaseTextEditorWidget::lowercaseSelection() +void TextEditorWidget::lowercaseSelection() { d->transformSelection(&QString_toLower); } -void BaseTextEditorWidget::indent() +void TextEditorWidget::indent() { setTextCursor(textDocument()->indent(textCursor())); } -void BaseTextEditorWidget::unindent() +void TextEditorWidget::unindent() { setTextCursor(textDocument()->unindent(textCursor())); } -void BaseTextEditorWidget::undo() +void TextEditorWidget::undo() { if (d->m_inBlockSelectionMode) d->disableBlockSelection(false); QPlainTextEdit::undo(); } -void BaseTextEditorWidget::redo() +void TextEditorWidget::redo() { if (d->m_inBlockSelectionMode) d->disableBlockSelection(false); QPlainTextEdit::redo(); } -void BaseTextEditorWidget::openLinkUnderCursor() +void TextEditorWidget::openLinkUnderCursor() { const bool openInNextSplit = alwaysOpenLinksInNextSplit(); Link symbolLink = findLinkAt(textCursor(), true, openInNextSplit); openLink(symbolLink, openInNextSplit); } -void BaseTextEditorWidget::openLinkUnderCursorInNextSplit() +void TextEditorWidget::openLinkUnderCursorInNextSplit() { const bool openInNextSplit = !alwaysOpenLinksInNextSplit(); Link symbolLink = findLinkAt(textCursor(), true, openInNextSplit); openLink(symbolLink, openInNextSplit); } -void BaseTextEditorWidget::abortAssist() +void TextEditorWidget::abortAssist() { d->m_codeAssistant.destroyContext(); } -void BaseTextEditorWidgetPrivate::moveLineUpDown(bool up) +void TextEditorWidgetPrivate::moveLineUpDown(bool up) { QTextCursor cursor = q->textCursor(); QTextCursor move = cursor; @@ -1553,7 +1553,7 @@ void BaseTextEditorWidgetPrivate::moveLineUpDown(bool up) m_moveLineUndoHack = true; } -void BaseTextEditorWidget::cleanWhitespace() +void TextEditorWidget::cleanWhitespace() { d->m_document->cleanWhitespace(textCursor()); } @@ -1574,7 +1574,7 @@ static QTextLine currentTextLine(const QTextCursor &cursor) return layout->lineForTextPosition(relativePos); } -bool BaseTextEditorWidgetPrivate::camelCaseLeft(QTextCursor &cursor, QTextCursor::MoveMode mode) +bool TextEditorWidgetPrivate::camelCaseLeft(QTextCursor &cursor, QTextCursor::MoveMode mode) { int state = 0; enum Input { @@ -1684,7 +1684,7 @@ bool BaseTextEditorWidgetPrivate::camelCaseLeft(QTextCursor &cursor, QTextCursor } } -bool BaseTextEditorWidgetPrivate::camelCaseRight(QTextCursor &cursor, QTextCursor::MoveMode mode) +bool TextEditorWidgetPrivate::camelCaseRight(QTextCursor &cursor, QTextCursor::MoveMode mode) { int state = 0; enum Input { @@ -1800,7 +1800,7 @@ bool BaseTextEditorWidgetPrivate::camelCaseRight(QTextCursor &cursor, QTextCurso } } -bool BaseTextEditorWidgetPrivate::cursorMoveKeyEvent(QKeyEvent *e) +bool TextEditorWidgetPrivate::cursorMoveKeyEvent(QKeyEvent *e) { QTextCursor cursor = q->textCursor(); @@ -1906,22 +1906,22 @@ bool BaseTextEditorWidgetPrivate::cursorMoveKeyEvent(QKeyEvent *e) return true; } -void BaseTextEditorWidget::viewPageUp() +void TextEditorWidget::viewPageUp() { verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub); } -void BaseTextEditorWidget::viewPageDown() +void TextEditorWidget::viewPageDown() { verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd); } -void BaseTextEditorWidget::viewLineUp() +void TextEditorWidget::viewLineUp() { verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepSub); } -void BaseTextEditorWidget::viewLineDown() +void TextEditorWidget::viewLineDown() { verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepAdd); } @@ -1946,7 +1946,7 @@ static inline bool isPrintableText(const QString &text) return !text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t')); } -void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e) +void TextEditorWidget::keyPressEvent(QKeyEvent *e) { if (!isModifier(e) && mouseHidingEnabled()) viewport()->setCursor(Qt::BlankCursor); @@ -2344,7 +2344,7 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e) d->m_codeAssistant.process(); } -void BaseTextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg, const QString &snippet) +void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg, const QString &snippet) { Snippet::ParsedSnippet data = Snippet::parse(snippet); @@ -2377,7 +2377,7 @@ void BaseTextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg, cons d->m_document->autoIndent(cursor); cursor.endEditBlock(); - setExtraSelections(BaseTextEditorWidget::SnippetPlaceholderSelection, selections); + setExtraSelections(TextEditorWidget::SnippetPlaceholderSelection, selections); d->m_snippetOverlay->setNameMangler(manglers); if (!selections.isEmpty()) { @@ -2394,13 +2394,13 @@ void BaseTextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg, cons } } -void BaseTextEditorWidgetPrivate::universalHelper() +void TextEditorWidgetPrivate::universalHelper() { // Test function for development. Place your new fangled experiment here to // give it proper scrutiny before pushing it onto others. } -void BaseTextEditorWidget::setTextCursor(const QTextCursor &cursor, bool keepBlockSelection) +void TextEditorWidget::setTextCursor(const QTextCursor &cursor, bool keepBlockSelection) { // workaround for QTextControl bug bool selectionChange = cursor.hasSelection() || textCursor().hasSelection(); @@ -2413,12 +2413,12 @@ void BaseTextEditorWidget::setTextCursor(const QTextCursor &cursor, bool keepBlo d->slotSelectionChanged(); } -void BaseTextEditorWidget::setTextCursor(const QTextCursor &cursor) +void TextEditorWidget::setTextCursor(const QTextCursor &cursor) { setTextCursor(cursor, false); } -void BaseTextEditorWidget::gotoLine(int line, int column, bool centerLine) +void TextEditorWidget::gotoLine(int line, int column, bool centerLine) { d->m_lastCursorChangeWasInteresting = false; // avoid adding the previous position to history const int blockNumber = line - 1; @@ -2444,7 +2444,7 @@ void BaseTextEditorWidget::gotoLine(int line, int column, bool centerLine) d->saveCurrentCursorPositionForNavigation(); } -int BaseTextEditorWidget::position(BaseTextEditor::PositionOperation posOp, int at) const +int TextEditorWidget::position(BaseTextEditor::PositionOperation posOp, int at) const { QTextCursor tc = textCursor(); @@ -2475,7 +2475,7 @@ int BaseTextEditorWidget::position(BaseTextEditor::PositionOperation posOp, int return -1; } -QRect BaseTextEditorWidget::cursorRect(int pos) const +QRect TextEditorWidget::cursorRect(int pos) const { QTextCursor tc = textCursor(); if (pos >= 0) @@ -2485,12 +2485,12 @@ QRect BaseTextEditorWidget::cursorRect(int pos) const return result; } -void BaseTextEditorWidget::convertPosition(int pos, int *line, int *column) const +void TextEditorWidget::convertPosition(int pos, int *line, int *column) const { Convenience::convertPosition(document(), pos, line, column); } -bool BaseTextEditorWidget::event(QEvent *e) +bool TextEditorWidget::event(QEvent *e) { // FIXME: That's far too heavy, and triggers e.g for ChildEvent if (d && e->type() != QEvent::InputMethodQuery) @@ -2512,7 +2512,7 @@ bool BaseTextEditorWidget::event(QEvent *e) return QPlainTextEdit::event(e); } -void BaseTextEditorWidget::inputMethodEvent(QInputMethodEvent *e) +void TextEditorWidget::inputMethodEvent(QInputMethodEvent *e) { if (d->m_inBlockSelectionMode) { if (!e->commitString().isEmpty()) @@ -2522,14 +2522,14 @@ void BaseTextEditorWidget::inputMethodEvent(QInputMethodEvent *e) QPlainTextEdit::inputMethodEvent(e); } -void BaseTextEditorWidgetPrivate::documentAboutToBeReloaded() +void TextEditorWidgetPrivate::documentAboutToBeReloaded() { //memorize cursor position m_tempState = q->saveState(); // remove extra selections (loads of QTextCursor objects) - for (int i = 0; i < BaseTextEditorWidget::NExtraSelectionKinds; ++i) + for (int i = 0; i < TextEditorWidget::NExtraSelectionKinds; ++i) m_extraSelections[i].clear(); q->QPlainTextEdit::setExtraSelections(QList<QTextEdit::ExtraSelection>()); @@ -2540,7 +2540,7 @@ void BaseTextEditorWidgetPrivate::documentAboutToBeReloaded() m_refactorOverlay->clear(); } -void BaseTextEditorWidgetPrivate::documentReloadFinished(bool success) +void TextEditorWidgetPrivate::documentReloadFinished(bool success) { if (!success) return; @@ -2550,7 +2550,7 @@ void BaseTextEditorWidgetPrivate::documentReloadFinished(bool success) updateCannotDecodeInfo(); } -QByteArray BaseTextEditorWidget::saveState() const +QByteArray TextEditorWidget::saveState() const { QByteArray state; QDataStream stream(&state, QIODevice::WriteOnly); @@ -2577,7 +2577,7 @@ QByteArray BaseTextEditorWidget::saveState() const return state; } -bool BaseTextEditorWidget::restoreState(const QByteArray &state) +bool TextEditorWidget::restoreState(const QByteArray &state) { if (state.isEmpty()) { if (d->m_displaySettings.m_autoFoldFirstComment) @@ -2628,80 +2628,80 @@ bool BaseTextEditorWidget::restoreState(const QByteArray &state) return true; } -void BaseTextEditorWidget::setParenthesesMatchingEnabled(bool b) +void TextEditorWidget::setParenthesesMatchingEnabled(bool b) { d->m_parenthesesMatchingEnabled = b; } -bool BaseTextEditorWidget::isParenthesesMatchingEnabled() const +bool TextEditorWidget::isParenthesesMatchingEnabled() const { return d->m_parenthesesMatchingEnabled; } -void BaseTextEditorWidget::setHighlightCurrentLine(bool b) +void TextEditorWidget::setHighlightCurrentLine(bool b) { d->m_highlightCurrentLine = b; d->updateCurrentLineHighlight(); } -bool BaseTextEditorWidget::highlightCurrentLine() const +bool TextEditorWidget::highlightCurrentLine() const { return d->m_highlightCurrentLine; } -void BaseTextEditorWidget::setLineNumbersVisible(bool b) +void TextEditorWidget::setLineNumbersVisible(bool b) { d->m_lineNumbersVisible = b; d->slotUpdateExtraAreaWidth(); } -bool BaseTextEditorWidget::lineNumbersVisible() const +bool TextEditorWidget::lineNumbersVisible() const { return d->m_lineNumbersVisible; } -void BaseTextEditorWidget::setAlwaysOpenLinksInNextSplit(bool b) +void TextEditorWidget::setAlwaysOpenLinksInNextSplit(bool b) { d->m_displaySettings.m_openLinksInNextSplit = b; } -bool BaseTextEditorWidget::alwaysOpenLinksInNextSplit() const +bool TextEditorWidget::alwaysOpenLinksInNextSplit() const { return d->m_displaySettings.m_openLinksInNextSplit; } -void BaseTextEditorWidget::setMarksVisible(bool b) +void TextEditorWidget::setMarksVisible(bool b) { d->m_marksVisible = b; d->slotUpdateExtraAreaWidth(); } -bool BaseTextEditorWidget::marksVisible() const +bool TextEditorWidget::marksVisible() const { return d->m_marksVisible; } -void BaseTextEditorWidget::setRequestMarkEnabled(bool b) +void TextEditorWidget::setRequestMarkEnabled(bool b) { d->m_requestMarkEnabled = b; } -bool BaseTextEditorWidget::requestMarkEnabled() const +bool TextEditorWidget::requestMarkEnabled() const { return d->m_requestMarkEnabled; } -void BaseTextEditorWidget::setLineSeparatorsAllowed(bool b) +void TextEditorWidget::setLineSeparatorsAllowed(bool b) { d->m_lineSeparatorsAllowed = b; } -bool BaseTextEditorWidget::lineSeparatorsAllowed() const +bool TextEditorWidget::lineSeparatorsAllowed() const { return d->m_lineSeparatorsAllowed; } -void BaseTextEditorWidgetPrivate::updateCodeFoldingVisible() +void TextEditorWidgetPrivate::updateCodeFoldingVisible() { const bool visible = m_codeFoldingSupported && m_displaySettings.m_displayFoldingMarkers; if (m_codeFoldingVisible != visible) { @@ -2710,12 +2710,12 @@ void BaseTextEditorWidgetPrivate::updateCodeFoldingVisible() } } -void BaseTextEditorWidgetPrivate::reconfigure() +void TextEditorWidgetPrivate::reconfigure() { q->configureMimeType(MimeDatabase::findByFile(m_document->filePath())); } -bool BaseTextEditorWidget::codeFoldingVisible() const +bool TextEditorWidget::codeFoldingVisible() const { return d->m_codeFoldingVisible; } @@ -2726,103 +2726,104 @@ bool BaseTextEditorWidget::codeFoldingVisible() const * * Needs to be called before calling setCodeFoldingVisible. */ -void BaseTextEditorWidget::setCodeFoldingSupported(bool b) +void TextEditorWidget::setCodeFoldingSupported(bool b) { d->m_codeFoldingSupported = b; d->updateCodeFoldingVisible(); } -bool BaseTextEditorWidget::codeFoldingSupported() const +bool TextEditorWidget::codeFoldingSupported() const { return d->m_codeFoldingSupported; } -void BaseTextEditorWidget::setMouseNavigationEnabled(bool b) +void TextEditorWidget::setMouseNavigationEnabled(bool b) { d->m_behaviorSettings.m_mouseNavigation = b; } -bool BaseTextEditorWidget::mouseNavigationEnabled() const +bool TextEditorWidget::mouseNavigationEnabled() const { return d->m_behaviorSettings.m_mouseNavigation; } -void BaseTextEditorWidget::setMouseHidingEnabled(bool b) +void TextEditorWidget::setMouseHidingEnabled(bool b) { d->m_behaviorSettings.m_mouseHiding = b; } -bool BaseTextEditorWidget::mouseHidingEnabled() const +bool TextEditorWidget::mouseHidingEnabled() const { return d->m_behaviorSettings.m_mouseHiding; } -void BaseTextEditorWidget::setScrollWheelZoomingEnabled(bool b) +void TextEditorWidget::setScrollWheelZoomingEnabled(bool b) { d->m_behaviorSettings.m_scrollWheelZooming = b; } -bool BaseTextEditorWidget::scrollWheelZoomingEnabled() const +bool TextEditorWidget::scrollWheelZoomingEnabled() const { return d->m_behaviorSettings.m_scrollWheelZooming; } -void BaseTextEditorWidget::setConstrainTooltips(bool b) +void TextEditorWidget::setConstrainTooltips(bool b) { d->m_behaviorSettings.m_constrainHoverTooltips = b; } -bool BaseTextEditorWidget::constrainTooltips() const +bool TextEditorWidget::constrainTooltips() const { return d->m_behaviorSettings.m_constrainHoverTooltips; } -void BaseTextEditorWidget::setCamelCaseNavigationEnabled(bool b) +void TextEditorWidget::setCamelCaseNavigationEnabled(bool b) { d->m_behaviorSettings.m_camelCaseNavigation = b; } -bool BaseTextEditorWidget::camelCaseNavigationEnabled() const +bool TextEditorWidget::camelCaseNavigationEnabled() const { return d->m_behaviorSettings.m_camelCaseNavigation; } -void BaseTextEditorWidget::setRevisionsVisible(bool b) +void TextEditorWidget::setRevisionsVisible(bool b) { d->m_revisionsVisible = b; d->slotUpdateExtraAreaWidth(); } -bool BaseTextEditorWidget::revisionsVisible() const +bool TextEditorWidget::revisionsVisible() const { return d->m_revisionsVisible; } -void BaseTextEditorWidget::setVisibleWrapColumn(int column) +void TextEditorWidget::setVisibleWrapColumn(int column) { d->m_visibleWrapColumn = column; viewport()->update(); } -int BaseTextEditorWidget::visibleWrapColumn() const +int TextEditorWidget::visibleWrapColumn() const { return d->m_visibleWrapColumn; } -void BaseTextEditorWidget::setAutoCompleter(AutoCompleter *autoCompleter) +void TextEditorWidget::setAutoCompleter(AutoCompleter *autoCompleter) { d->m_autoCompleter.reset(autoCompleter); } -AutoCompleter *BaseTextEditorWidget::autoCompleter() const +AutoCompleter *TextEditorWidget::autoCompleter() const { return d->m_autoCompleter.data(); } -//--------- BaseTextEditorPrivate ----------- - +// +// TextEditorWidgetPrivate +// -void BaseTextEditorWidgetPrivate::setupDocumentSignals() +void TextEditorWidgetPrivate::setupDocumentSignals() { QTextDocument *doc = m_document->document(); q->QPlainTextEdit::setDocument(doc); @@ -2832,28 +2833,28 @@ void BaseTextEditorWidgetPrivate::setupDocumentSignals() QTC_CHECK(documentLayout); QObject::connect(documentLayout, &QPlainTextDocumentLayout::updateBlock, - this, &BaseTextEditorWidgetPrivate::slotUpdateBlockNotify); + this, &TextEditorWidgetPrivate::slotUpdateBlockNotify); QObject::connect(documentLayout, &TextDocumentLayout::updateExtraArea, m_extraArea, static_cast<void (QWidget::*)()>(&QWidget::update)); - QObject::connect(q, &BaseTextEditorWidget::requestBlockUpdate, + QObject::connect(q, &TextEditorWidget::requestBlockUpdate, documentLayout, &QPlainTextDocumentLayout::updateBlock); QObject::connect(doc, &QTextDocument::contentsChange, - this, &BaseTextEditorWidgetPrivate::editorContentsChange); + this, &TextEditorWidgetPrivate::editorContentsChange); QObject::connect(m_document.data(), &TextDocument::aboutToReload, - this, &BaseTextEditorWidgetPrivate::documentAboutToBeReloaded); + this, &TextEditorWidgetPrivate::documentAboutToBeReloaded); QObject::connect(m_document.data(), &TextDocument::reloadFinished, - this, &BaseTextEditorWidgetPrivate::documentReloadFinished); + this, &TextEditorWidgetPrivate::documentReloadFinished); QObject::connect(m_document.data(), &TextDocument::tabSettingsChanged, - this, &BaseTextEditorWidgetPrivate::updateTabStops); + this, &TextEditorWidgetPrivate::updateTabStops); QObject::connect(m_document.data(), &TextDocument::fontSettingsChanged, - this, &BaseTextEditorWidgetPrivate::applyFontSettingsDelayed); + this, &TextEditorWidgetPrivate::applyFontSettingsDelayed); slotUpdateExtraAreaWidth(); @@ -2863,23 +2864,23 @@ void BaseTextEditorWidgetPrivate::setupDocumentSignals() connect(settings, &TextEditorSettings::fontSettingsChanged, m_document.data(), &TextDocument::setFontSettings); connect(settings, &TextEditorSettings::typingSettingsChanged, - q, &BaseTextEditorWidget::setTypingSettings); + q, &TextEditorWidget::setTypingSettings); connect(settings, &TextEditorSettings::storageSettingsChanged, - q, &BaseTextEditorWidget::setStorageSettings); + q, &TextEditorWidget::setStorageSettings); connect(settings, &TextEditorSettings::behaviorSettingsChanged, - q, &BaseTextEditorWidget::setBehaviorSettings); + q, &TextEditorWidget::setBehaviorSettings); connect(settings, &TextEditorSettings::marginSettingsChanged, - q, &BaseTextEditorWidget::setMarginSettings); + q, &TextEditorWidget::setMarginSettings); connect(settings, &TextEditorSettings::displaySettingsChanged, - q, &BaseTextEditorWidget::setDisplaySettings); + q, &TextEditorWidget::setDisplaySettings); connect(settings, &TextEditorSettings::completionSettingsChanged, - q, &BaseTextEditorWidget::setCompletionSettings); + q, &TextEditorWidget::setCompletionSettings); connect(settings, &TextEditorSettings::extraEncodingSettingsChanged, - q, &BaseTextEditorWidget::setExtraEncodingSettings); + q, &TextEditorWidget::setExtraEncodingSettings); - connect(q, &BaseTextEditorWidget::requestFontZoom, + connect(q, &TextEditorWidget::requestFontZoom, settings, &TextEditorSettings::fontZoomRequested); - connect(q, &BaseTextEditorWidget::requestZoomReset, + connect(q, &TextEditorWidget::requestZoomReset, settings, &TextEditorSettings::zoomResetRequested); // Apply current settings @@ -2895,7 +2896,7 @@ void BaseTextEditorWidgetPrivate::setupDocumentSignals() q->setCodeStyle(settings->codeStyle(q->languageSettingsId())); } -bool BaseTextEditorWidgetPrivate::snippetCheckCursor(const QTextCursor &cursor) +bool TextEditorWidgetPrivate::snippetCheckCursor(const QTextCursor &cursor) { if (!m_snippetOverlay->isVisible() || m_snippetOverlay->isEmpty()) return false; @@ -2915,7 +2916,7 @@ bool BaseTextEditorWidgetPrivate::snippetCheckCursor(const QTextCursor &cursor) return true; } -void BaseTextEditorWidgetPrivate::snippetTabOrBacktab(bool forward) +void TextEditorWidgetPrivate::snippetTabOrBacktab(bool forward) { if (!m_snippetOverlay->isVisible() || m_snippetOverlay->isEmpty()) return; @@ -2953,13 +2954,13 @@ void BaseTextEditorWidgetPrivate::snippetTabOrBacktab(bool forward) } // Calculate global position for a tooltip considering the left extra area. -QPoint BaseTextEditorWidget::toolTipPosition(const QTextCursor &c) const +QPoint TextEditorWidget::toolTipPosition(const QTextCursor &c) const { const QPoint cursorPos = mapToGlobal(cursorRect(c).bottomRight() + QPoint(1,1)); return cursorPos + QPoint(d->m_extraArea->width(), HostOsInfo::isWindowsHost() ? -24 : -16); } -void BaseTextEditorWidgetPrivate::processTooltipRequest(const QTextCursor &c) +void TextEditorWidgetPrivate::processTooltipRequest(const QTextCursor &c) { const QPoint toolTipPoint = q->toolTipPosition(c); bool handled = false; @@ -2968,7 +2969,7 @@ void BaseTextEditorWidgetPrivate::processTooltipRequest(const QTextCursor &c) emit q->tooltipRequested(toolTipPoint, c.position()); } -bool BaseTextEditorWidget::viewportEvent(QEvent *event) +bool TextEditorWidget::viewportEvent(QEvent *event) { d->m_contentsChanged = false; if (event->type() == QEvent::ToolTip) { @@ -3006,7 +3007,7 @@ bool BaseTextEditorWidget::viewportEvent(QEvent *event) } -void BaseTextEditorWidget::resizeEvent(QResizeEvent *e) +void TextEditorWidget::resizeEvent(QResizeEvent *e) { QPlainTextEdit::resizeEvent(e); QRect cr = rect(); @@ -3015,7 +3016,7 @@ void BaseTextEditorWidget::resizeEvent(QResizeEvent *e) QRect(cr.left(), cr.top(), extraAreaWidth(), cr.height()))); } -QRect BaseTextEditorWidgetPrivate::foldBox() +QRect TextEditorWidgetPrivate::foldBox() { if (m_highlightBlocksInfo.isEmpty() || extraAreaHighlightFoldedBlockNumber < 0) return QRect(); @@ -3034,7 +3035,7 @@ QRect BaseTextEditorWidgetPrivate::foldBox() er.bottom() - br.top()); } -QTextBlock BaseTextEditorWidgetPrivate::foldedBlockAt(const QPoint &pos, QRect *box) const +QTextBlock TextEditorWidgetPrivate::foldedBlockAt(const QPoint &pos, QRect *box) const { QPointF offset = q->contentOffset(); QTextBlock block = q->firstVisibleBlock(); @@ -3081,7 +3082,7 @@ QTextBlock BaseTextEditorWidgetPrivate::foldedBlockAt(const QPoint &pos, QRect * return QTextBlock(); } -void BaseTextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block, +void TextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block, TextEditorOverlay *overlay) { if (m_searchExpr.isEmpty()) @@ -3123,7 +3124,7 @@ void BaseTextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block } } -QString BaseTextEditorWidgetPrivate::copyBlockSelection() +QString TextEditorWidgetPrivate::copyBlockSelection() { if (!m_inBlockSelectionMode) return QString(); @@ -3168,7 +3169,7 @@ QString BaseTextEditorWidgetPrivate::copyBlockSelection() return selection; } -void BaseTextEditorWidgetPrivate::setCursorToColumn(QTextCursor &cursor, int column, QTextCursor::MoveMode moveMode) +void TextEditorWidgetPrivate::setCursorToColumn(QTextCursor &cursor, int column, QTextCursor::MoveMode moveMode) { const TabSettings &ts = m_document->tabSettings(); int offset = 0; @@ -3194,7 +3195,7 @@ void BaseTextEditorWidgetPrivate::setCursorToColumn(QTextCursor &cursor, int col cursor.block().text(), column), moveMode); } -void BaseTextEditorWidgetPrivate::insertIntoBlockSelection(const QString &text) +void TextEditorWidgetPrivate::insertIntoBlockSelection(const QString &text) { // TODO: add autocompleter support QTextCursor cursor = q->textCursor(); @@ -3276,7 +3277,7 @@ void BaseTextEditorWidgetPrivate::insertIntoBlockSelection(const QString &text) q->setTextCursor(m_blockSelection.selection(m_document.data()), true); } -void BaseTextEditorWidgetPrivate::removeBlockSelection() +void TextEditorWidgetPrivate::removeBlockSelection() { QTextCursor cursor = q->textCursor(); if (!cursor.hasSelection() || !m_inBlockSelectionMode) @@ -3318,7 +3319,7 @@ void BaseTextEditorWidgetPrivate::removeBlockSelection() q->setTextCursor(cursor, m_blockSelection.hasSelection()); } -void BaseTextEditorWidgetPrivate::enableBlockSelection(const QTextCursor &cursor) +void TextEditorWidgetPrivate::enableBlockSelection(const QTextCursor &cursor) { const TabSettings &ts = m_document->tabSettings(); const QTextBlock &positionTextBlock = cursor.block(); @@ -3334,7 +3335,7 @@ void BaseTextEditorWidgetPrivate::enableBlockSelection(const QTextCursor &cursor enableBlockSelection(positionBlock, anchorColumn, anchorBlock, positionColumn); } -void BaseTextEditorWidgetPrivate::enableBlockSelection(int positionBlock, int positionColumn, +void TextEditorWidgetPrivate::enableBlockSelection(int positionBlock, int positionColumn, int anchorBlock, int anchorColumn) { m_blockSelection.fromPostition(positionBlock, anchorColumn, anchorBlock, positionColumn); @@ -3344,7 +3345,7 @@ void BaseTextEditorWidgetPrivate::enableBlockSelection(int positionBlock, int po q->viewport()->update(); } -void BaseTextEditorWidgetPrivate::disableBlockSelection(bool keepSelection) +void TextEditorWidgetPrivate::disableBlockSelection(bool keepSelection) { m_inBlockSelectionMode = false; m_cursorFlashTimer.stop(); @@ -3356,7 +3357,7 @@ void BaseTextEditorWidgetPrivate::disableBlockSelection(bool keepSelection) q->viewport()->update(); } -void BaseTextEditorWidgetPrivate::resetCursorFlashTimer() +void TextEditorWidgetPrivate::resetCursorFlashTimer() { m_cursorVisible = true; const int flashTime = qApp->cursorFlashTime(); @@ -3366,7 +3367,7 @@ void BaseTextEditorWidgetPrivate::resetCursorFlashTimer() } } -void BaseTextEditorWidgetPrivate::moveCursorVisible(bool ensureVisible) +void TextEditorWidgetPrivate::moveCursorVisible(bool ensureVisible) { QTextCursor cursor = q->textCursor(); if (!cursor.block().isVisible()) { @@ -3432,7 +3433,7 @@ static QTextLayout::FormatRange createBlockCursorCharFormatRange(int pos, const return o; } -void BaseTextEditorWidget::paintEvent(QPaintEvent *e) +void TextEditorWidget::paintEvent(QPaintEvent *e) { // draw backgrond to the right of the wrap column before everything else qreal lineX = 0; @@ -4111,21 +4112,21 @@ void BaseTextEditorWidget::paintEvent(QPaintEvent *e) } } -void BaseTextEditorWidget::paintBlock(QPainter *painter, - const QTextBlock &block, - const QPointF &offset, - const QVector<QTextLayout::FormatRange> &selections, - const QRect &clipRect) const +void TextEditorWidget::paintBlock(QPainter *painter, + const QTextBlock &block, + const QPointF &offset, + const QVector<QTextLayout::FormatRange> &selections, + const QRect &clipRect) const { block.layout()->draw(painter, offset, selections, clipRect); } -int BaseTextEditorWidget::visibleFoldedBlockNumber() const +int TextEditorWidget::visibleFoldedBlockNumber() const { return d->visibleFoldedBlockNumber; } -void BaseTextEditorWidget::drawCollapsedBlockPopup(QPainter &painter, +void TextEditorWidget::drawCollapsedBlockPopup(QPainter &painter, const QTextBlock &block, QPointF offset, const QRect &clip) @@ -4180,12 +4181,12 @@ void BaseTextEditorWidget::drawCollapsedBlockPopup(QPainter &painter, } } -QWidget *BaseTextEditorWidget::extraArea() const +QWidget *TextEditorWidget::extraArea() const { return d->m_extraArea; } -int BaseTextEditorWidget::extraAreaWidth(int *markWidthPtr) const +int TextEditorWidget::extraAreaWidth(int *markWidthPtr) const { TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(document()->documentLayout()); if (!documentLayout) @@ -4231,7 +4232,7 @@ int BaseTextEditorWidget::extraAreaWidth(int *markWidthPtr) const return space; } -void BaseTextEditorWidgetPrivate::slotUpdateExtraAreaWidth() +void TextEditorWidgetPrivate::slotUpdateExtraAreaWidth() { if (q->isLeftToRight()) q->setViewportMargins(q->extraAreaWidth(), 0, 0, 0); @@ -4267,7 +4268,7 @@ static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool e painter->restore(); } -void BaseTextEditorWidget::extraAreaPaintEvent(QPaintEvent *e) +void TextEditorWidget::extraAreaPaintEvent(QPaintEvent *e) { QTextDocument *doc = document(); TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); @@ -4447,7 +4448,7 @@ void BaseTextEditorWidget::extraAreaPaintEvent(QPaintEvent *e) } } -void BaseTextEditorWidgetPrivate::drawFoldingMarker(QPainter *painter, const QPalette &pal, +void TextEditorWidgetPrivate::drawFoldingMarker(QPainter *painter, const QPalette &pal, const QRect &rect, bool expanded, bool active, @@ -4506,7 +4507,7 @@ void BaseTextEditorWidgetPrivate::drawFoldingMarker(QPainter *painter, const QPa } } -void BaseTextEditorWidgetPrivate::slotUpdateRequest(const QRect &r, int dy) +void TextEditorWidgetPrivate::slotUpdateRequest(const QRect &r, int dy) { if (dy) { m_extraArea->scroll(0, dy); @@ -4522,13 +4523,13 @@ void BaseTextEditorWidgetPrivate::slotUpdateRequest(const QRect &r, int dy) slotUpdateExtraAreaWidth(); } -void BaseTextEditorWidgetPrivate::saveCurrentCursorPositionForNavigation() +void TextEditorWidgetPrivate::saveCurrentCursorPositionForNavigation() { m_lastCursorChangeWasInteresting = true; m_tempNavigationState = q->saveState(); } -void BaseTextEditorWidgetPrivate::updateCurrentLineHighlight() +void TextEditorWidgetPrivate::updateCurrentLineHighlight() { QList<QTextEdit::ExtraSelection> extraSelections; @@ -4542,7 +4543,7 @@ void BaseTextEditorWidgetPrivate::updateCurrentLineHighlight() extraSelections.append(sel); } - q->setExtraSelections(BaseTextEditorWidget::CurrentLineSelection, extraSelections); + q->setExtraSelections(TextEditorWidget::CurrentLineSelection, extraSelections); // the extra area shows information for the entire current block, not just the currentline. // This is why we must force a bigger update region. @@ -4559,7 +4560,7 @@ void BaseTextEditorWidgetPrivate::updateCurrentLineHighlight() } } -void BaseTextEditorWidget::slotCursorPositionChanged() +void TextEditorWidget::slotCursorPositionChanged() { #if 0 qDebug() << "block" << textCursor().blockNumber()+1 @@ -4577,11 +4578,11 @@ void BaseTextEditorWidget::slotCursorPositionChanged() d->updateHighlights(); } -void BaseTextEditorWidgetPrivate::updateHighlights() +void TextEditorWidgetPrivate::updateHighlights() { if (m_parenthesesMatchingEnabled && q->hasFocus()) { // Delay update when no matching is displayed yet, to avoid flicker - if (q->extraSelections(BaseTextEditorWidget::ParenthesesMatchingSelection).isEmpty() + if (q->extraSelections(TextEditorWidget::ParenthesesMatchingSelection).isEmpty() && m_animator == 0) { m_parenthesesMatchingTimer.start(50); } else { @@ -4589,7 +4590,7 @@ void BaseTextEditorWidgetPrivate::updateHighlights() // we need clear current selection before viewport update // otherwise we get sticky highlighted parentheses if (!m_displaySettings.m_highlightMatchingParentheses) - q->setExtraSelections(BaseTextEditorWidget::ParenthesesMatchingSelection, QList<QTextEdit::ExtraSelection>()); + q->setExtraSelections(TextEditorWidget::ParenthesesMatchingSelection, QList<QTextEdit::ExtraSelection>()); // use 0-timer, not direct call, to give the syntax highlighter a chance // to update the parentheses information @@ -4606,7 +4607,7 @@ void BaseTextEditorWidgetPrivate::updateHighlights() } } -void BaseTextEditorWidgetPrivate::slotUpdateBlockNotify(const QTextBlock &block) +void TextEditorWidgetPrivate::slotUpdateBlockNotify(const QTextBlock &block) { static bool blockRecursion = false; if (blockRecursion) @@ -4639,7 +4640,7 @@ void BaseTextEditorWidgetPrivate::slotUpdateBlockNotify(const QTextBlock &block) blockRecursion = false; } -void BaseTextEditorWidget::timerEvent(QTimerEvent *e) +void TextEditorWidget::timerEvent(QTimerEvent *e) { if (e->timerId() == d->autoScrollTimer.timerId()) { const QPoint globalPos = QCursor::pos(); @@ -4669,7 +4670,7 @@ void BaseTextEditorWidget::timerEvent(QTimerEvent *e) } -void BaseTextEditorWidgetPrivate::clearVisibleFoldedBlock() +void TextEditorWidgetPrivate::clearVisibleFoldedBlock() { if (suggestedVisibleFoldedBlockNumber) { suggestedVisibleFoldedBlockNumber = -1; @@ -4681,7 +4682,7 @@ void BaseTextEditorWidgetPrivate::clearVisibleFoldedBlock() } } -void BaseTextEditorWidget::mouseMoveEvent(QMouseEvent *e) +void TextEditorWidget::mouseMoveEvent(QMouseEvent *e) { d->updateLink(e); @@ -4760,7 +4761,7 @@ static bool handleForwardBackwardMouseButtons(QMouseEvent *e) return false; } -void BaseTextEditorWidget::mousePressEvent(QMouseEvent *e) +void TextEditorWidget::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::LeftButton) { if (e->modifiers() == Qt::AltModifier) { @@ -4815,7 +4816,7 @@ void BaseTextEditorWidget::mousePressEvent(QMouseEvent *e) QPlainTextEdit::mousePressEvent(e); } -void BaseTextEditorWidget::mouseReleaseEvent(QMouseEvent *e) +void TextEditorWidget::mouseReleaseEvent(QMouseEvent *e) { if (mouseNavigationEnabled() && d->m_linkPressed @@ -4839,7 +4840,7 @@ void BaseTextEditorWidget::mouseReleaseEvent(QMouseEvent *e) QPlainTextEdit::mouseReleaseEvent(e); } -void BaseTextEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) +void TextEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) { if (e->button() == Qt::LeftButton) { QTextCursor cursor = textCursor(); @@ -4853,14 +4854,14 @@ void BaseTextEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) QPlainTextEdit::mouseDoubleClickEvent(e); } -void BaseTextEditorWidget::leaveEvent(QEvent *e) +void TextEditorWidget::leaveEvent(QEvent *e) { // Clear link emulation when the mouse leaves the editor d->clearLink(); QPlainTextEdit::leaveEvent(e); } -void BaseTextEditorWidget::keyReleaseEvent(QKeyEvent *e) +void TextEditorWidget::keyReleaseEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Control) { d->clearLink(); @@ -4877,7 +4878,7 @@ void BaseTextEditorWidget::keyReleaseEvent(QKeyEvent *e) QPlainTextEdit::keyReleaseEvent(e); } -void BaseTextEditorWidget::dragEnterEvent(QDragEnterEvent *e) +void TextEditorWidget::dragEnterEvent(QDragEnterEvent *e) { // If the drag event contains URLs, we don't want to insert them as text if (e->mimeData()->hasUrls()) { @@ -4897,7 +4898,7 @@ static void appendMenuActionsFromContext(QMenu *menu, Id menuContextId) menu->addAction(action); } -void BaseTextEditorWidget::showDefaultContextMenu(QContextMenuEvent *e, Id menuContextId) +void TextEditorWidget::showDefaultContextMenu(QContextMenuEvent *e, Id menuContextId) { QMenu menu; appendMenuActionsFromContext(&menu, menuContextId); @@ -4905,14 +4906,14 @@ void BaseTextEditorWidget::showDefaultContextMenu(QContextMenuEvent *e, Id menuC menu.exec(e->globalPos()); } -void BaseTextEditorWidget::extraAreaLeaveEvent(QEvent *) +void TextEditorWidget::extraAreaLeaveEvent(QEvent *) { // fake missing mouse move event from Qt QMouseEvent me(QEvent::MouseMove, QPoint(-1, -1), Qt::NoButton, 0, 0); extraAreaMouseEvent(&me); } -void BaseTextEditorWidget::extraAreaContextMenuEvent(QContextMenuEvent *e) +void TextEditorWidget::extraAreaContextMenuEvent(QContextMenuEvent *e) { if (d->m_marksVisible) { QTextCursor cursor = cursorForPosition(QPoint(0, e->pos().y())); @@ -4925,7 +4926,7 @@ void BaseTextEditorWidget::extraAreaContextMenuEvent(QContextMenuEvent *e) } } -void BaseTextEditorWidget::updateFoldingHighlight(const QPoint &pos) +void TextEditorWidget::updateFoldingHighlight(const QPoint &pos) { if (!d->m_codeFoldingVisible) return; @@ -4947,7 +4948,7 @@ void BaseTextEditorWidget::updateFoldingHighlight(const QPoint &pos) d->m_highlightBlocksTimer.start(d->m_highlightBlocksInfo.isEmpty() ? 120 : 0); } -void BaseTextEditorWidget::extraAreaMouseEvent(QMouseEvent *e) +void TextEditorWidget::extraAreaMouseEvent(QMouseEvent *e) { QTextCursor cursor = cursorForPosition(QPoint(0, e->pos().y())); @@ -5088,7 +5089,7 @@ void BaseTextEditorWidget::extraAreaMouseEvent(QMouseEvent *e) } } -void BaseTextEditorWidget::ensureCursorVisible() +void TextEditorWidget::ensureCursorVisible() { QTextBlock block = textCursor().block(); if (!block.isVisible()) { @@ -5115,7 +5116,7 @@ void BaseTextEditorWidget::ensureCursorVisible() QPlainTextEdit::ensureCursorVisible(); } -void BaseTextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block) +void TextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block) { auto documentLayout = qobject_cast<TextDocumentLayout*>(q->document()->documentLayout()); QTC_ASSERT(documentLayout, return); @@ -5125,17 +5126,17 @@ void BaseTextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block) documentLayout->emitDocumentSizeChanged(); } -void BaseTextEditorWidget::setLanguageSettingsId(Id settingsId) +void TextEditorWidget::setLanguageSettingsId(Id settingsId) { d->m_tabSettingsId = settingsId; } -Id BaseTextEditorWidget::languageSettingsId() const +Id TextEditorWidget::languageSettingsId() const { return d->m_tabSettingsId; } -void BaseTextEditorWidget::setCodeStyle(ICodeStylePreferences *preferences) +void TextEditorWidget::setCodeStyle(ICodeStylePreferences *preferences) { textDocument()->indenter()->setCodeStylePreferences(preferences); if (d->m_codeStylePreferences) { @@ -5155,22 +5156,22 @@ void BaseTextEditorWidget::setCodeStyle(ICodeStylePreferences *preferences) } } -void BaseTextEditorWidget::slotCodeStyleSettingsChanged(const QVariant &) +void TextEditorWidget::slotCodeStyleSettingsChanged(const QVariant &) { } -const DisplaySettings &BaseTextEditorWidget::displaySettings() const +const DisplaySettings &TextEditorWidget::displaySettings() const { return d->m_displaySettings; } -const MarginSettings &BaseTextEditorWidget::marginSettings() const +const MarginSettings &TextEditorWidget::marginSettings() const { return d->m_marginSettings; } -void BaseTextEditorWidgetPrivate::handleHomeKey(bool anchor) +void TextEditorWidgetPrivate::handleHomeKey(bool anchor) { QTextCursor cursor = q->textCursor(); QTextCursor::MoveMode mode = QTextCursor::MoveAnchor; @@ -5198,7 +5199,7 @@ void BaseTextEditorWidgetPrivate::handleHomeKey(bool anchor) q->setTextCursor(cursor); } -void BaseTextEditorWidgetPrivate::handleBackspaceKey() +void TextEditorWidgetPrivate::handleBackspaceKey() { QTextCursor cursor = q->textCursor(); QTC_ASSERT(!cursor.hasSelection(), return); @@ -5293,7 +5294,7 @@ void BaseTextEditorWidgetPrivate::handleBackspaceKey() q->setTextCursor(cursor); } -void BaseTextEditorWidget::wheelEvent(QWheelEvent *e) +void TextEditorWidget::wheelEvent(QWheelEvent *e) { d->clearVisibleFoldedBlock(); if (scrollWheelZoomingEnabled() && e->modifiers() & Qt::ControlModifier) { @@ -5307,29 +5308,29 @@ void BaseTextEditorWidget::wheelEvent(QWheelEvent *e) QPlainTextEdit::wheelEvent(e); } -void BaseTextEditorWidget::zoomIn() +void TextEditorWidget::zoomIn() { d->clearVisibleFoldedBlock(); emit requestFontZoom(10); } -void BaseTextEditorWidget::zoomOut() +void TextEditorWidget::zoomOut() { d->clearVisibleFoldedBlock(); emit requestFontZoom(-10); } -void BaseTextEditorWidget::zoomReset() +void TextEditorWidget::zoomReset() { emit requestZoomReset(); } -BaseTextEditorWidget::Link BaseTextEditorWidget::findLinkAt(const QTextCursor &, bool, bool) +TextEditorWidget::Link TextEditorWidget::findLinkAt(const QTextCursor &, bool, bool) { return Link(); } -bool BaseTextEditorWidget::openLink(const Link &link, bool inNextSplit) +bool TextEditorWidget::openLink(const Link &link, bool inNextSplit) { if (!link.hasValidTarget()) return false; @@ -5348,7 +5349,7 @@ bool BaseTextEditorWidget::openLink(const Link &link, bool inNextSplit) Id(), flags); } -void BaseTextEditorWidgetPrivate::updateLink(QMouseEvent *e) +void TextEditorWidgetPrivate::updateLink(QMouseEvent *e) { bool linkFound = false; @@ -5364,7 +5365,7 @@ void BaseTextEditorWidgetPrivate::updateLink(QMouseEvent *e) onText = q->cursorRect(nextPos).right() >= e->x(); } - const BaseTextEditorWidget::Link link = q->findLinkAt(cursor, false); + const TextEditorWidget::Link link = q->findLinkAt(cursor, false); if (onText && link.hasValidLinkText()) { showLink(link); @@ -5376,7 +5377,7 @@ void BaseTextEditorWidgetPrivate::updateLink(QMouseEvent *e) clearLink(); } -void BaseTextEditorWidgetPrivate::showLink(const BaseTextEditorWidget::Link &link) +void TextEditorWidgetPrivate::showLink(const TextEditorWidget::Link &link) { if (m_currentLink == link) return; @@ -5387,24 +5388,24 @@ void BaseTextEditorWidgetPrivate::showLink(const BaseTextEditorWidget::Link &lin sel.cursor.setPosition(link.linkTextEnd, QTextCursor::KeepAnchor); sel.format = q->textDocument()->fontSettings().toTextCharFormat(C_LINK); sel.format.setFontUnderline(true); - q->setExtraSelections(BaseTextEditorWidget::OtherSelection, QList<QTextEdit::ExtraSelection>() << sel); + q->setExtraSelections(TextEditorWidget::OtherSelection, QList<QTextEdit::ExtraSelection>() << sel); q->viewport()->setCursor(Qt::PointingHandCursor); m_currentLink = link; m_linkPressed = false; } -void BaseTextEditorWidgetPrivate::clearLink() +void TextEditorWidgetPrivate::clearLink() { if (!m_currentLink.hasValidLinkText()) return; - q->setExtraSelections(BaseTextEditorWidget::OtherSelection, QList<QTextEdit::ExtraSelection>()); + q->setExtraSelections(TextEditorWidget::OtherSelection, QList<QTextEdit::ExtraSelection>()); q->viewport()->setCursor(Qt::IBeamCursor); - m_currentLink = BaseTextEditorWidget::Link(); + m_currentLink = TextEditorWidget::Link(); m_linkPressed = false; } -void BaseTextEditorWidgetPrivate::highlightSearchResultsSlot(const QString &txt, FindFlags findFlags) +void TextEditorWidgetPrivate::highlightSearchResultsSlot(const QString &txt, FindFlags findFlags) { if (m_searchExpr.pattern() == txt) return; @@ -5418,17 +5419,17 @@ void BaseTextEditorWidgetPrivate::highlightSearchResultsSlot(const QString &txt, m_delayedUpdateTimer.start(50); } -int BaseTextEditorWidget::verticalBlockSelectionFirstColumn() const +int TextEditorWidget::verticalBlockSelectionFirstColumn() const { return d->m_inBlockSelectionMode ? d->m_blockSelection.firstVisualColumn() : -1; } -int BaseTextEditorWidget::verticalBlockSelectionLastColumn() const +int TextEditorWidget::verticalBlockSelectionLastColumn() const { return d->m_inBlockSelectionMode ? d->m_blockSelection.lastVisualColumn() : -1; } -QRegion BaseTextEditorWidget::translatedLineRegion(int lineStart, int lineEnd) const +QRegion TextEditorWidget::translatedLineRegion(int lineStart, int lineEnd) const { QRegion region; for (int i = lineStart ; i <= lineEnd; i++) { @@ -5447,7 +5448,7 @@ QRegion BaseTextEditorWidget::translatedLineRegion(int lineStart, int lineEnd) c return region; } -void BaseTextEditorWidgetPrivate::setFindScope(const QTextCursor &start, const QTextCursor &end, +void TextEditorWidgetPrivate::setFindScope(const QTextCursor &start, const QTextCursor &end, int verticalBlockSelectionFirstColumn, int verticalBlockSelectionLastColumn) { @@ -5463,7 +5464,7 @@ void BaseTextEditorWidgetPrivate::setFindScope(const QTextCursor &start, const Q } } -void BaseTextEditorWidgetPrivate::_q_animateUpdate(int position, QPointF lastPos, QRectF rect) +void TextEditorWidgetPrivate::_q_animateUpdate(int position, QPointF lastPos, QRectF rect) { QTextCursor cursor = q->textCursor(); cursor.setPosition(position); @@ -5473,17 +5474,17 @@ void BaseTextEditorWidgetPrivate::_q_animateUpdate(int position, QPointF lastPos } -BaseTextEditorAnimator::BaseTextEditorAnimator(QObject *parent) +TextEditorAnimator::TextEditorAnimator(QObject *parent) : QObject(parent), m_timeline(256) { m_value = 0; m_timeline.setCurveShape(QTimeLine::SineCurve); - connect(&m_timeline, &QTimeLine::valueChanged, this, &BaseTextEditorAnimator::step); + connect(&m_timeline, &QTimeLine::valueChanged, this, &TextEditorAnimator::step); connect(&m_timeline, &QTimeLine::finished, this, &QObject::deleteLater); m_timeline.start(); } -void BaseTextEditorAnimator::setData(const QFont &f, const QPalette &pal, const QString &text) +void TextEditorAnimator::setData(const QFont &f, const QPalette &pal, const QString &text) { m_font = f; m_palette = pal; @@ -5492,7 +5493,7 @@ void BaseTextEditorAnimator::setData(const QFont &f, const QPalette &pal, const m_size = QSizeF(fm.width(m_text), fm.height()); } -void BaseTextEditorAnimator::draw(QPainter *p, const QPointF &pos) +void TextEditorAnimator::draw(QPainter *p, const QPointF &pos) { m_lastDrawPos = pos; p->setPen(m_palette.text().color()); @@ -5507,12 +5508,12 @@ void BaseTextEditorAnimator::draw(QPainter *p, const QPointF &pos) p->drawText(r, m_text); } -bool BaseTextEditorAnimator::isRunning() const +bool TextEditorAnimator::isRunning() const { return m_timeline.state() == QTimeLine::Running; } -QRectF BaseTextEditorAnimator::rect() const +QRectF TextEditorAnimator::rect() const { QFont f = m_font; f.setPointSizeF(f.pointSizeF() * (1.0 + m_value/2)); @@ -5521,7 +5522,7 @@ QRectF BaseTextEditorAnimator::rect() const return QRectF((m_size.width()-width)/2, (m_size.height() - fm.height())/2, width, fm.height()); } -void BaseTextEditorAnimator::step(qreal v) +void TextEditorAnimator::step(qreal v) { QRectF before = rect(); m_value = v; @@ -5529,14 +5530,14 @@ void BaseTextEditorAnimator::step(qreal v) emit updateRequest(m_position, m_lastDrawPos, before.united(after)); } -void BaseTextEditorAnimator::finish() +void TextEditorAnimator::finish() { m_timeline.stop(); step(0); deleteLater(); } -void BaseTextEditorWidgetPrivate::_q_matchParentheses() +void TextEditorWidgetPrivate::_q_matchParentheses() { if (q->isReadOnly() || !(m_displaySettings.m_highlightMatchingParentheses @@ -5553,7 +5554,7 @@ void BaseTextEditorWidgetPrivate::_q_matchParentheses() QList<QTextEdit::ExtraSelection> extraSelections; if (backwardMatchType == TextBlockUserData::NoMatch && forwardMatchType == TextBlockUserData::NoMatch) { - q->setExtraSelections(BaseTextEditorWidget::ParenthesesMatchingSelection, extraSelections); // clear + q->setExtraSelections(TextEditorWidget::ParenthesesMatchingSelection, extraSelections); // clear return; } @@ -5610,7 +5611,7 @@ void BaseTextEditorWidgetPrivate::_q_matchParentheses() if (animatePosition >= 0) { - foreach (const QTextEdit::ExtraSelection &sel, q->extraSelections(BaseTextEditorWidget::ParenthesesMatchingSelection)) { + foreach (const QTextEdit::ExtraSelection &sel, q->extraSelections(TextEditorWidget::ParenthesesMatchingSelection)) { if (sel.cursor.selectionStart() == animatePosition || sel.cursor.selectionEnd() - 1 == animatePosition) { animatePosition = -1; @@ -5622,22 +5623,22 @@ void BaseTextEditorWidgetPrivate::_q_matchParentheses() if (animatePosition >= 0) { if (m_animator) m_animator->finish(); // one animation is enough - m_animator = new BaseTextEditorAnimator(this); + m_animator = new TextEditorAnimator(this); m_animator->setPosition(animatePosition); QPalette pal; pal.setBrush(QPalette::Text, matchFormat.foreground()); pal.setBrush(QPalette::Base, matchFormat.background()); m_animator->setData(q->font(), pal, q->document()->characterAt(m_animator->position())); - connect(m_animator.data(), &BaseTextEditorAnimator::updateRequest, - this, &BaseTextEditorWidgetPrivate::_q_animateUpdate); + connect(m_animator.data(), &TextEditorAnimator::updateRequest, + this, &TextEditorWidgetPrivate::_q_animateUpdate); } if (m_displaySettings.m_highlightMatchingParentheses) - q->setExtraSelections(BaseTextEditorWidget::ParenthesesMatchingSelection, extraSelections); + q->setExtraSelections(TextEditorWidget::ParenthesesMatchingSelection, extraSelections); } -void BaseTextEditorWidgetPrivate::_q_highlightBlocks() +void TextEditorWidgetPrivate::_q_highlightBlocks() { - BaseTextEditorPrivateHighlightBlocks highlightBlocksInfo; + TextEditorPrivateHighlightBlocks highlightBlocksInfo; QTextBlock block; if (extraAreaHighlightFoldedBlockNumber >= 0) { @@ -5696,7 +5697,7 @@ void BaseTextEditorWidgetPrivate::_q_highlightBlocks() } } -void BaseTextEditorWidget::changeEvent(QEvent *e) +void TextEditorWidget::changeEvent(QEvent *e) { QPlainTextEdit::changeEvent(e); if (e->type() == QEvent::ApplicationFontChange @@ -5711,13 +5712,13 @@ void BaseTextEditorWidget::changeEvent(QEvent *e) } } -void BaseTextEditorWidget::focusInEvent(QFocusEvent *e) +void TextEditorWidget::focusInEvent(QFocusEvent *e) { QPlainTextEdit::focusInEvent(e); d->updateHighlights(); } -void BaseTextEditorWidget::focusOutEvent(QFocusEvent *e) +void TextEditorWidget::focusOutEvent(QFocusEvent *e) { QPlainTextEdit::focusOutEvent(e); if (viewport()->cursor().shape() == Qt::BlankCursor) @@ -5725,7 +5726,7 @@ void BaseTextEditorWidget::focusOutEvent(QFocusEvent *e) } -void BaseTextEditorWidgetPrivate::maybeSelectLine() +void TextEditorWidgetPrivate::maybeSelectLine() { QTextCursor cursor = q->textCursor(); if (!cursor.hasSelection()) { @@ -5743,14 +5744,14 @@ void BaseTextEditorWidgetPrivate::maybeSelectLine() } // shift+del -void BaseTextEditorWidget::cutLine() +void TextEditorWidget::cutLine() { d->maybeSelectLine(); cut(); } // ctrl+ins -void BaseTextEditorWidget::copyLine() +void TextEditorWidget::copyLine() { QTextCursor prevCursor = textCursor(); d->maybeSelectLine(); @@ -5760,20 +5761,20 @@ void BaseTextEditorWidget::copyLine() setTextCursor(prevCursor, d->m_inBlockSelectionMode); } -void BaseTextEditorWidget::deleteLine() +void TextEditorWidget::deleteLine() { d->maybeSelectLine(); textCursor().removeSelectedText(); } -void BaseTextEditorWidget::deleteEndOfWord() +void TextEditorWidget::deleteEndOfWord() { moveCursor(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); textCursor().removeSelectedText(); setTextCursor(textCursor()); } -void BaseTextEditorWidget::deleteEndOfWordCamelCase() +void TextEditorWidget::deleteEndOfWordCamelCase() { QTextCursor c = textCursor(); d->camelCaseRight(c, QTextCursor::KeepAnchor); @@ -5781,14 +5782,14 @@ void BaseTextEditorWidget::deleteEndOfWordCamelCase() setTextCursor(c); } -void BaseTextEditorWidget::deleteStartOfWord() +void TextEditorWidget::deleteStartOfWord() { moveCursor(QTextCursor::StartOfWord, QTextCursor::KeepAnchor); textCursor().removeSelectedText(); setTextCursor(textCursor()); } -void BaseTextEditorWidget::deleteStartOfWordCamelCase() +void TextEditorWidget::deleteStartOfWordCamelCase() { QTextCursor c = textCursor(); d->camelCaseLeft(c, QTextCursor::KeepAnchor); @@ -5796,7 +5797,7 @@ void BaseTextEditorWidget::deleteStartOfWordCamelCase() setTextCursor(c); } -void BaseTextEditorWidget::setExtraSelections(ExtraSelectionKind kind, const QList<QTextEdit::ExtraSelection> &selections) +void TextEditorWidget::setExtraSelections(ExtraSelectionKind kind, const QList<QTextEdit::ExtraSelection> &selections) { if (selections.isEmpty() && d->m_extraSelections[kind].isEmpty()) return; @@ -5833,12 +5834,12 @@ void BaseTextEditorWidget::setExtraSelections(ExtraSelectionKind kind, const QLi } } -QList<QTextEdit::ExtraSelection> BaseTextEditorWidget::extraSelections(ExtraSelectionKind kind) const +QList<QTextEdit::ExtraSelection> TextEditorWidget::extraSelections(ExtraSelectionKind kind) const { return d->m_extraSelections[kind]; } -QString BaseTextEditorWidget::extraSelectionTooltip(int pos) const +QString TextEditorWidget::extraSelectionTooltip(int pos) const { QList<QTextEdit::ExtraSelection> all; for (int i = 0; i < NExtraSelectionKinds; ++i) { @@ -5855,7 +5856,7 @@ QString BaseTextEditorWidget::extraSelectionTooltip(int pos) const } // the blocks list must be sorted -void BaseTextEditorWidget::setIfdefedOutBlocks(const QList<BlockRange> &blocks) +void TextEditorWidget::setIfdefedOutBlocks(const QList<BlockRange> &blocks) { QTextDocument *doc = document(); TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); @@ -5904,7 +5905,7 @@ void BaseTextEditorWidget::setIfdefedOutBlocks(const QList<BlockRange> &blocks) documentLayout->requestUpdate(); } -void BaseTextEditorWidget::format() +void TextEditorWidget::format() { QTextCursor cursor = textCursor(); cursor.beginEditBlock(); @@ -5912,7 +5913,7 @@ void BaseTextEditorWidget::format() cursor.endEditBlock(); } -void BaseTextEditorWidget::rewrapParagraph() +void TextEditorWidget::rewrapParagraph() { const int paragraphWidth = marginSettings().m_marginColumn; const QRegExp anyLettersOrNumbers = QRegExp(QLatin1String("\\w")); @@ -6038,33 +6039,33 @@ void BaseTextEditorWidget::rewrapParagraph() cursor.endEditBlock(); } -void BaseTextEditorWidget::unCommentSelection() +void TextEditorWidget::unCommentSelection() { Utils::unCommentSelection(this, d->m_commentDefinition); } -void BaseTextEditorWidget::showEvent(QShowEvent* e) +void TextEditorWidget::showEvent(QShowEvent* e) { triggerPendingUpdates(); QPlainTextEdit::showEvent(e); } -void BaseTextEditorWidgetPrivate::applyFontSettingsDelayed() +void TextEditorWidgetPrivate::applyFontSettingsDelayed() { m_fontSettingsNeedsApply = true; if (q->isVisible()) q->triggerPendingUpdates(); } -void BaseTextEditorWidget::triggerPendingUpdates() +void TextEditorWidget::triggerPendingUpdates() { if (d->m_fontSettingsNeedsApply) applyFontSettings(); textDocument()->triggerPendingUpdates(); } -void BaseTextEditorWidget::applyFontSettings() +void TextEditorWidget::applyFontSettings() { d->m_fontSettingsNeedsApply = false; const FontSettings &fs = textDocument()->fontSettings(); @@ -6102,7 +6103,7 @@ void BaseTextEditorWidget::applyFontSettings() d->updateHighlights(); } -void BaseTextEditorWidget::setDisplaySettings(const DisplaySettings &ds) +void TextEditorWidget::setDisplaySettings(const DisplaySettings &ds) { setLineWrapMode(ds.m_textWrapping ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap); setLineNumbersVisible(ds.m_displayLineNumbers); @@ -6126,7 +6127,7 @@ void BaseTextEditorWidget::setDisplaySettings(const DisplaySettings &ds) d->m_displaySettings = ds; if (!ds.m_highlightBlocks) { d->extraAreaHighlightFoldedBlockNumber = -1; - d->m_highlightBlocksInfo = BaseTextEditorPrivateHighlightBlocks(); + d->m_highlightBlocksInfo = TextEditorPrivateHighlightBlocks(); } d->updateCodeFoldingVisible(); @@ -6135,7 +6136,7 @@ void BaseTextEditorWidget::setDisplaySettings(const DisplaySettings &ds) extraArea()->update(); } -void BaseTextEditorWidget::setMarginSettings(const MarginSettings &ms) +void TextEditorWidget::setMarginSettings(const MarginSettings &ms) { setVisibleWrapColumn(ms.m_showMargin ? ms.m_marginColumn : 0); d->m_marginSettings = ms; @@ -6144,34 +6145,34 @@ void BaseTextEditorWidget::setMarginSettings(const MarginSettings &ms) extraArea()->update(); } -void BaseTextEditorWidget::setBehaviorSettings(const TextEditor::BehaviorSettings &bs) +void TextEditorWidget::setBehaviorSettings(const TextEditor::BehaviorSettings &bs) { d->m_behaviorSettings = bs; } -void BaseTextEditorWidget::setTypingSettings(const TypingSettings &typingSettings) +void TextEditorWidget::setTypingSettings(const TypingSettings &typingSettings) { d->m_document->setTypingSettings(typingSettings); } -void BaseTextEditorWidget::setStorageSettings(const StorageSettings &storageSettings) +void TextEditorWidget::setStorageSettings(const StorageSettings &storageSettings) { d->m_document->setStorageSettings(storageSettings); } -void BaseTextEditorWidget::setCompletionSettings(const TextEditor::CompletionSettings &completionSettings) +void TextEditorWidget::setCompletionSettings(const TextEditor::CompletionSettings &completionSettings) { d->m_autoCompleter->setAutoParenthesesEnabled(completionSettings.m_autoInsertBrackets); d->m_autoCompleter->setSurroundWithEnabled(completionSettings.m_autoInsertBrackets && completionSettings.m_surroundingAutoBrackets); } -void BaseTextEditorWidget::setExtraEncodingSettings(const ExtraEncodingSettings &extraEncodingSettings) +void TextEditorWidget::setExtraEncodingSettings(const ExtraEncodingSettings &extraEncodingSettings) { d->m_document->setExtraEncodingSettings(extraEncodingSettings); } -void BaseTextEditorWidget::fold() +void TextEditorWidget::fold() { QTextDocument *doc = document(); TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); @@ -6191,7 +6192,7 @@ void BaseTextEditorWidget::fold() } } -void BaseTextEditorWidget::unfold() +void TextEditorWidget::unfold() { QTextDocument *doc = document(); TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); @@ -6205,7 +6206,7 @@ void BaseTextEditorWidget::unfold() documentLayout->emitDocumentSizeChanged(); } -void BaseTextEditorWidget::unfoldAll() +void TextEditorWidget::unfoldAll() { QTextDocument *doc = document(); TextDocumentLayout *documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); @@ -6235,7 +6236,7 @@ void BaseTextEditorWidget::unfoldAll() centerCursor(); } -void BaseTextEditorWidget::setReadOnly(bool b) +void TextEditorWidget::setReadOnly(bool b) { QPlainTextEdit::setReadOnly(b); emit readOnlyChanged(); @@ -6243,7 +6244,7 @@ void BaseTextEditorWidget::setReadOnly(bool b) setTextInteractionFlags(textInteractionFlags() | Qt::TextSelectableByKeyboard); } -void BaseTextEditorWidget::cut() +void TextEditorWidget::cut() { if (d->m_inBlockSelectionMode) { copy(); @@ -6254,14 +6255,14 @@ void BaseTextEditorWidget::cut() d->collectToCircularClipboard(); } -void BaseTextEditorWidget::selectAll() +void TextEditorWidget::selectAll() { if (d->m_inBlockSelectionMode) d->disableBlockSelection(); QPlainTextEdit::selectAll(); } -void BaseTextEditorWidget::copy() +void TextEditorWidget::copy() { if (!textCursor().hasSelection() || (d->m_inBlockSelectionMode && d->m_blockSelection.anchorColumn == d->m_blockSelection.positionColumn)) { @@ -6272,27 +6273,27 @@ void BaseTextEditorWidget::copy() d->collectToCircularClipboard(); } -void BaseTextEditorWidget::paste() +void TextEditorWidget::paste() { QPlainTextEdit::paste(); } -void BaseTextEditorWidgetPrivate::collectToCircularClipboard() +void TextEditorWidgetPrivate::collectToCircularClipboard() { const QMimeData *mimeData = QApplication::clipboard()->mimeData(); if (!mimeData) return; CircularClipboard *circularClipBoard = CircularClipboard::instance(); - circularClipBoard->collect(BaseTextEditorWidget::duplicateMimeData(mimeData)); + circularClipBoard->collect(TextEditorWidget::duplicateMimeData(mimeData)); // We want the latest copied content to be the first one to appear on circular paste. circularClipBoard->toLastCollect(); } -void BaseTextEditorWidget::circularPaste() +void TextEditorWidget::circularPaste() { CircularClipboard *circularClipBoard = CircularClipboard::instance(); if (const QMimeData *clipboardData = QApplication::clipboard()->mimeData()) { - circularClipBoard->collect(BaseTextEditorWidget::duplicateMimeData(clipboardData)); + circularClipBoard->collect(TextEditorWidget::duplicateMimeData(clipboardData)); circularClipBoard->toLastCollect(); } @@ -6300,17 +6301,17 @@ void BaseTextEditorWidget::circularPaste() return invokeAssist(QuickFix, d->m_clipboardAssistProvider.data()); if (const QMimeData *mimeData = circularClipBoard->next().data()) { - QApplication::clipboard()->setMimeData(BaseTextEditorWidget::duplicateMimeData(mimeData)); + QApplication::clipboard()->setMimeData(TextEditorWidget::duplicateMimeData(mimeData)); paste(); } } -void BaseTextEditorWidget::switchUtf8bom() +void TextEditorWidget::switchUtf8bom() { textDocument()->switchUtf8Bom(); } -QMimeData *BaseTextEditorWidget::createMimeDataFromSelection() const +QMimeData *TextEditorWidget::createMimeDataFromSelection() const { if (d->m_inBlockSelectionMode) { QMimeData *mimeData = new QMimeData; @@ -6403,12 +6404,12 @@ QMimeData *BaseTextEditorWidget::createMimeDataFromSelection() const return 0; } -bool BaseTextEditorWidget::canInsertFromMimeData(const QMimeData *source) const +bool TextEditorWidget::canInsertFromMimeData(const QMimeData *source) const { return QPlainTextEdit::canInsertFromMimeData(source); } -void BaseTextEditorWidget::insertFromMimeData(const QMimeData *source) +void TextEditorWidget::insertFromMimeData(const QMimeData *source) { if (isReadOnly()) return; @@ -6489,7 +6490,7 @@ void BaseTextEditorWidget::insertFromMimeData(const QMimeData *source) setTextCursor(cursor); } -QMimeData *BaseTextEditorWidget::duplicateMimeData(const QMimeData *source) +QMimeData *TextEditorWidget::duplicateMimeData(const QMimeData *source) { Q_ASSERT(source); @@ -6504,12 +6505,12 @@ QMimeData *BaseTextEditorWidget::duplicateMimeData(const QMimeData *source) return mimeData; } -QString BaseTextEditorWidget::lineNumber(int blockNumber) const +QString TextEditorWidget::lineNumber(int blockNumber) const { return QString::number(blockNumber + 1); } -int BaseTextEditorWidget::lineNumberDigits() const +int TextEditorWidget::lineNumberDigits() const { int digits = 2; int max = qMax(1, blockCount()); @@ -6520,32 +6521,32 @@ int BaseTextEditorWidget::lineNumberDigits() const return digits; } -bool BaseTextEditorWidget::selectionVisible(int blockNumber) const +bool TextEditorWidget::selectionVisible(int blockNumber) const { Q_UNUSED(blockNumber); return true; } -bool BaseTextEditorWidget::replacementVisible(int blockNumber) const +bool TextEditorWidget::replacementVisible(int blockNumber) const { Q_UNUSED(blockNumber) return true; } -QColor BaseTextEditorWidget::replacementPenColor(int blockNumber) const +QColor TextEditorWidget::replacementPenColor(int blockNumber) const { Q_UNUSED(blockNumber) return QColor(); } -void BaseTextEditorWidget::setupFallBackEditor(Id id) +void TextEditorWidget::setupFallBackEditor(Id id) { - BaseTextDocumentPtr doc(new TextDocument(id)); + TextDocumentPtr doc(new TextDocument(id)); doc->setFontSettings(TextEditorSettings::fontSettings()); setTextDocument(doc); } -void BaseTextEditorWidget::appendStandardContextMenuActions(QMenu *menu) +void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu) { menu->addSeparator(); @@ -6589,7 +6590,7 @@ BaseTextEditor::~BaseTextEditor() TextDocument *BaseTextEditor::textDocument() const { - BaseTextEditorWidget *widget = editorWidget(); + TextEditorWidget *widget = editorWidget(); QTC_CHECK(!widget->d->m_document.isNull()); return widget->d->m_document.data(); } @@ -6609,7 +6610,7 @@ QWidget *BaseTextEditor::toolBar() return editorWidget()->d->m_toolBar; } -void BaseTextEditorWidget::insertExtraToolBarWidget(BaseTextEditorWidget::Side side, +void TextEditorWidget::insertExtraToolBarWidget(TextEditorWidget::Side side, QWidget *widget) { if (widget->sizePolicy().horizontalPolicy() & QSizePolicy::ExpandFlag) { @@ -6675,7 +6676,7 @@ void BaseTextEditor::remove(int length) editorWidget()->remove(length); } -void BaseTextEditorWidget::remove(int length) +void TextEditorWidget::remove(int length) { QTextCursor tc = textCursor(); tc.setPosition(tc.position() + length, QTextCursor::KeepAnchor); @@ -6692,7 +6693,7 @@ void BaseTextEditor::replace(int length, const QString &string) editorWidget()->replace(length, string); } -void BaseTextEditorWidget::replace(int length, const QString &string) +void TextEditorWidget::replace(int length, const QString &string) { QTextCursor tc = textCursor(); tc.setPosition(tc.position() + length, QTextCursor::KeepAnchor); @@ -6704,7 +6705,7 @@ void BaseTextEditor::setCursorPosition(int pos) editorWidget()->setCursorPosition(pos); } -void BaseTextEditorWidget::setCursorPosition(int pos) +void TextEditorWidget::setCursorPosition(int pos) { setBlockSelection(false); QTextCursor tc = textCursor(); @@ -6720,12 +6721,12 @@ void BaseTextEditor::select(int toPos) editorWidget()->setTextCursor(tc); } -CompletionAssistProvider *BaseTextEditorWidget::completionAssistProvider() const +CompletionAssistProvider *TextEditorWidget::completionAssistProvider() const { return d->m_completionAssistProvider; } -void BaseTextEditorWidgetPrivate::updateCursorPosition() +void TextEditorWidgetPrivate::updateCursorPosition() { const QTextCursor cursor = q->textCursor(); const QTextBlock block = cursor.block(); @@ -6750,12 +6751,12 @@ QString BaseTextEditor::contextHelpId() const return m_contextHelpId; } -RefactorMarkers BaseTextEditorWidget::refactorMarkers() const +RefactorMarkers TextEditorWidget::refactorMarkers() const { return d->m_refactorOverlay->markers(); } -void BaseTextEditorWidget::setRefactorMarkers(const RefactorMarkers &markers) +void TextEditorWidget::setRefactorMarkers(const RefactorMarkers &markers) { foreach (const RefactorMarker &marker, d->m_refactorOverlay->markers()) requestBlockUpdate(marker.cursor.block()); @@ -6764,7 +6765,7 @@ void BaseTextEditorWidget::setRefactorMarkers(const RefactorMarkers &markers) requestBlockUpdate(marker.cursor.block()); } -void BaseTextEditorWidget::doFoo() +void TextEditorWidget::doFoo() { #ifdef DO_FOO qDebug() << Q_FUNC_INFO; @@ -6777,7 +6778,7 @@ void BaseTextEditorWidget::doFoo() #endif } -BaseTextBlockSelection::BaseTextBlockSelection(const BaseTextBlockSelection &other) +TextBlockSelection::TextBlockSelection(const TextBlockSelection &other) { positionBlock = other.positionBlock; positionColumn = other.positionColumn; @@ -6785,24 +6786,24 @@ BaseTextBlockSelection::BaseTextBlockSelection(const BaseTextBlockSelection &oth anchorColumn = other.anchorColumn; } -void BaseTextBlockSelection::clear() +void TextBlockSelection::clear() { positionColumn = positionBlock = anchorColumn = anchorBlock = 0; } // returns a cursor which always has the complete selection -QTextCursor BaseTextBlockSelection::selection(const TextDocument *baseTextDocument) const +QTextCursor TextBlockSelection::selection(const TextDocument *baseTextDocument) const { return cursor(baseTextDocument, true); } // returns a cursor which always has the correct position and anchor -QTextCursor BaseTextBlockSelection::cursor(const TextDocument *baseTextDocument) const +QTextCursor TextBlockSelection::cursor(const TextDocument *baseTextDocument) const { return cursor(baseTextDocument, false); } -QTextCursor BaseTextBlockSelection::cursor(const TextDocument *baseTextDocument, +QTextCursor TextBlockSelection::cursor(const TextDocument *baseTextDocument, bool fullSelection) const { if (!baseTextDocument) @@ -6838,7 +6839,7 @@ QTextCursor BaseTextBlockSelection::cursor(const TextDocument *baseTextDocument, return cursor; } -void BaseTextBlockSelection::fromPostition(int positionBlock, int positionColumn, +void TextBlockSelection::fromPostition(int positionBlock, int positionColumn, int anchorBlock, int anchorColumn) { this->positionBlock = positionBlock; @@ -6847,14 +6848,14 @@ void BaseTextBlockSelection::fromPostition(int positionBlock, int positionColumn this->anchorColumn = anchorColumn; } -bool BaseTextEditorWidgetPrivate::inFindScope(const QTextCursor &cursor) +bool TextEditorWidgetPrivate::inFindScope(const QTextCursor &cursor) { if (cursor.isNull()) return false; return inFindScope(cursor.selectionStart(), cursor.selectionEnd()); } -bool BaseTextEditorWidgetPrivate::inFindScope(int selectionStart, int selectionEnd) +bool TextEditorWidgetPrivate::inFindScope(int selectionStart, int selectionEnd) { if (m_findScopeStart.isNull()) return true; // no scope, everything is included @@ -6878,7 +6879,7 @@ bool BaseTextEditorWidgetPrivate::inFindScope(int selectionStart, int selectionE return true; } -void BaseTextEditorWidget::setBlockSelection(bool on) +void TextEditorWidget::setBlockSelection(bool on) { if (d->m_inBlockSelectionMode == on) return; @@ -6889,28 +6890,28 @@ void BaseTextEditorWidget::setBlockSelection(bool on) d->disableBlockSelection(false); } -void BaseTextEditorWidget::setBlockSelection(int positionBlock, int positionColumn, +void TextEditorWidget::setBlockSelection(int positionBlock, int positionColumn, int anchhorBlock, int anchorColumn) { d->enableBlockSelection(positionBlock, positionColumn, anchhorBlock, anchorColumn); } -void BaseTextEditorWidget::setBlockSelection(const QTextCursor &cursor) +void TextEditorWidget::setBlockSelection(const QTextCursor &cursor) { d->enableBlockSelection(cursor); } -QTextCursor BaseTextEditorWidget::blockSelection() const +QTextCursor TextEditorWidget::blockSelection() const { return d->m_blockSelection.cursor(d->m_document.data()); } -bool BaseTextEditorWidget::hasBlockSelection() const +bool TextEditorWidget::hasBlockSelection() const { return d->m_inBlockSelectionMode; } -void BaseTextEditorWidgetPrivate::updateTabStops() +void TextEditorWidgetPrivate::updateTabStops() { // Although the tab stop is stored as qreal the API from QPlainTextEdit only allows it // to be set as an int. A work around is to access directly the QTextOption. @@ -6920,13 +6921,13 @@ void BaseTextEditorWidgetPrivate::updateTabStops() q->document()->setDefaultTextOption(option); } -int BaseTextEditorWidget::columnCount() const +int TextEditorWidget::columnCount() const { QFontMetricsF fm(font()); return viewport()->rect().width() / fm.width(QLatin1Char('x')); } -int BaseTextEditorWidget::rowCount() const +int TextEditorWidget::rowCount() const { QFontMetricsF fm(font()); return viewport()->rect().height() / fm.lineSpacing(); @@ -6941,7 +6942,7 @@ int BaseTextEditorWidget::rowCount() const @see uppercaseSelection, lowercaseSelection */ -void BaseTextEditorWidgetPrivate::transformSelection(TransformationMethod method) +void TextEditorWidgetPrivate::transformSelection(TransformationMethod method) { if (q->hasBlockSelection()) { transformBlockSelection(method); @@ -6974,7 +6975,7 @@ void BaseTextEditorWidgetPrivate::transformSelection(TransformationMethod method q->setTextCursor(cursor); } -void BaseTextEditorWidgetPrivate::transformBlockSelection(TransformationMethod method) +void TextEditorWidgetPrivate::transformBlockSelection(TransformationMethod method) { QTextCursor cursor = q->textCursor(); const TabSettings &ts = m_document->tabSettings(); @@ -7017,17 +7018,17 @@ void BaseTextEditorWidgetPrivate::transformBlockSelection(TransformationMethod m enableBlockSelection(positionBlock, anchorColumn, anchorBlock, positionColumn); } -void BaseTextEditorWidget::inSnippetMode(bool *active) +void TextEditorWidget::inSnippetMode(bool *active) { *active = d->m_snippetOverlay->isVisible(); } -void BaseTextEditorWidget::setCompletionAssistProvider(CompletionAssistProvider *provider) +void TextEditorWidget::setCompletionAssistProvider(CompletionAssistProvider *provider) { d->m_completionAssistProvider = provider; } -void BaseTextEditorWidget::invokeAssist(AssistKind kind, IAssistProvider *provider) +void TextEditorWidget::invokeAssist(AssistKind kind, IAssistProvider *provider) { bool previousMode = overwriteMode(); setOverwriteMode(false); @@ -7036,14 +7037,14 @@ void BaseTextEditorWidget::invokeAssist(AssistKind kind, IAssistProvider *provid setOverwriteMode(previousMode); } -AssistInterface *BaseTextEditorWidget::createAssistInterface(AssistKind kind, +AssistInterface *TextEditorWidget::createAssistInterface(AssistKind kind, AssistReason reason) const { Q_UNUSED(kind); return new AssistInterface(document(), position(), d->m_document->filePath(), reason); } -QString BaseTextEditorWidget::foldReplacementText(const QTextBlock &) const +QString TextEditorWidget::foldReplacementText(const QTextBlock &) const { return QLatin1String("..."); } @@ -7071,10 +7072,10 @@ BaseTextEditor *BaseTextEditor::currentTextEditor() return qobject_cast<BaseTextEditor *>(EditorManager::currentEditor()); } -BaseTextEditorWidget *BaseTextEditor::editorWidget() const +TextEditorWidget *BaseTextEditor::editorWidget() const { - QTC_ASSERT(qobject_cast<BaseTextEditorWidget *>(m_widget.data()), return 0); - return static_cast<BaseTextEditorWidget *>(m_widget.data()); + QTC_ASSERT(qobject_cast<TextEditorWidget *>(m_widget.data()), return 0); + return static_cast<TextEditorWidget *>(m_widget.data()); } QTextDocument *BaseTextEditor::qdocument() const @@ -7102,22 +7103,22 @@ QString BaseTextEditor::textAt(int from, int to) const return textDocument()->textAt(from, to); } -QChar BaseTextEditorWidget::characterAt(int pos) const +QChar TextEditorWidget::characterAt(int pos) const { return textDocument()->characterAt(pos); } -QString BaseTextEditorWidget::textAt(int from, int to) const +QString TextEditorWidget::textAt(int from, int to) const { return textDocument()->textAt(from, to); } -void BaseTextEditorWidget::configureMimeType(const QString &mimeType) +void TextEditorWidget::configureMimeType(const QString &mimeType) { configureMimeType(MimeDatabase::findByType(mimeType)); } -void BaseTextEditorWidget::configureMimeType(const MimeType &mimeType) +void TextEditorWidget::configureMimeType(const MimeType &mimeType) { Highlighter *highlighter = new Highlighter(); highlighter->setTabSettings(textDocument()->tabSettings()); @@ -7160,13 +7161,13 @@ void BaseTextEditorWidget::configureMimeType(const MimeType &mimeType) updateEditorInfoBar(this); } -bool BaseTextEditorWidget::isMissingSyntaxDefinition() const +bool TextEditorWidget::isMissingSyntaxDefinition() const { return d->m_isMissingSyntaxDefinition; } // The remnants of PlainTextEditor. -void BaseTextEditorWidget::setupAsPlainEditor() +void TextEditorWidget::setupAsPlainEditor() { setRevisionsVisible(true); setMarksVisible(true); @@ -7175,10 +7176,10 @@ void BaseTextEditorWidget::setupAsPlainEditor() textDocument()->setMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT)); connect(textDocument(), &IDocument::filePathChanged, - d, &BaseTextEditorWidgetPrivate::reconfigure); + d, &TextEditorWidgetPrivate::reconfigure); connect(Manager::instance(), &Manager::mimeTypesRegistered, - d, &BaseTextEditorWidgetPrivate::reconfigure); + d, &TextEditorWidgetPrivate::reconfigure); updateEditorInfoBar(this); } @@ -7199,41 +7200,41 @@ IEditor *BaseTextEditor::duplicate() // BaseTextEditorFactory // -BaseTextEditorFactory::BaseTextEditorFactory(QObject *parent) +TextEditorFactory::TextEditorFactory(QObject *parent) : IEditorFactory(parent) { m_editorCreator = []() { return new BaseTextEditor; }; - m_widgetCreator = []() { return new BaseTextEditorWidget; }; + m_widgetCreator = []() { return new TextEditorWidget; }; m_commentStyle = CommentDefinition::NoStyle; m_duplicatedSupported = true; } -void BaseTextEditorFactory::setDocumentCreator(const DocumentCreator &creator) +void TextEditorFactory::setDocumentCreator(const DocumentCreator &creator) { m_documentCreator = creator; } -void BaseTextEditorFactory::setEditorWidgetCreator(const EditorWidgetCreator &creator) +void TextEditorFactory::setEditorWidgetCreator(const EditorWidgetCreator &creator) { m_widgetCreator = creator; } -void BaseTextEditorFactory::setEditorCreator(const EditorCreator &creator) +void TextEditorFactory::setEditorCreator(const EditorCreator &creator) { m_editorCreator = creator; } -void BaseTextEditorFactory::setIndenterCreator(const IndenterCreator &creator) +void TextEditorFactory::setIndenterCreator(const IndenterCreator &creator) { m_indenterCreator = creator; } -void BaseTextEditorFactory::setSyntaxHighlighterCreator(const SyntaxHighLighterCreator &creator) +void TextEditorFactory::setSyntaxHighlighterCreator(const SyntaxHighLighterCreator &creator) { m_syntaxHighlighterCreator = creator; } -void BaseTextEditorFactory::setGenericSyntaxHighlighter(const QString &mimeType) +void TextEditorFactory::setGenericSyntaxHighlighter(const QString &mimeType) { m_syntaxHighlighterCreator = [this, mimeType]() -> SyntaxHighlighter * { Highlighter *highlighter = new TextEditor::Highlighter(); @@ -7242,41 +7243,41 @@ void BaseTextEditorFactory::setGenericSyntaxHighlighter(const QString &mimeType) }; } -void BaseTextEditorFactory::setAutoCompleterCreator(const AutoCompleterCreator &creator) +void TextEditorFactory::setAutoCompleterCreator(const AutoCompleterCreator &creator) { m_autoCompleterCreator = creator; } -void BaseTextEditorFactory::setEditorActionHandlers(Id contextId, uint optionalActions) +void TextEditorFactory::setEditorActionHandlers(Id contextId, uint optionalActions) { new TextEditorActionHandler(this, contextId, optionalActions); } -void BaseTextEditorFactory::setEditorActionHandlers(uint optionalActions) +void TextEditorFactory::setEditorActionHandlers(uint optionalActions) { new TextEditorActionHandler(this, id(), optionalActions); } -void BaseTextEditorFactory::setCommentStyle(CommentDefinition::Style style) +void TextEditorFactory::setCommentStyle(CommentDefinition::Style style) { m_commentStyle = style; } -void BaseTextEditorFactory::setDuplicatedSupported(bool on) +void TextEditorFactory::setDuplicatedSupported(bool on) { m_duplicatedSupported = on; } -BaseTextEditor *BaseTextEditorFactory::duplicateTextEditor(BaseTextEditor *other) +BaseTextEditor *TextEditorFactory::duplicateTextEditor(BaseTextEditor *other) { BaseTextEditor *editor = createEditorHelper(other->editorWidget()->textDocumentPtr()); editor->editorWidget()->finalizeInitializationAfterDuplication(other->editorWidget()); return editor; } -IEditor *BaseTextEditorFactory::createEditor() +IEditor *TextEditorFactory::createEditor() { - BaseTextDocumentPtr doc(m_documentCreator()); + TextDocumentPtr doc(m_documentCreator()); if (m_indenterCreator) doc->setIndenter(m_indenterCreator()); @@ -7290,9 +7291,9 @@ IEditor *BaseTextEditorFactory::createEditor() return createEditorHelper(doc); } -BaseTextEditor *BaseTextEditorFactory::createEditorHelper(const BaseTextDocumentPtr &document) +BaseTextEditor *TextEditorFactory::createEditorHelper(const TextDocumentPtr &document) { - BaseTextEditorWidget *widget = m_widgetCreator(); + TextEditorWidget *widget = m_widgetCreator(); BaseTextEditor *editor = m_editorCreator(); editor->setDuplicateSupported(m_duplicatedSupported); editor->addContext(id()); @@ -7309,30 +7310,30 @@ BaseTextEditor *BaseTextEditorFactory::createEditorHelper(const BaseTextDocument widget->d->m_codeAssistant.configure(widget); widget->d->m_commentDefinition.setStyle(m_commentStyle); - connect(widget, &BaseTextEditorWidget::markRequested, editor, + connect(widget, &TextEditorWidget::markRequested, editor, [editor](int line, BaseTextEditor::MarkRequestKind kind) { editor->markRequested(editor, line, kind); }); - connect(widget, &BaseTextEditorWidget::markContextMenuRequested, editor, + connect(widget, &TextEditorWidget::markContextMenuRequested, editor, [editor](int line, QMenu *menu) { editor->markContextMenuRequested(editor, line, menu); }); - connect(widget, &BaseTextEditorWidget::tooltipRequested, editor, + connect(widget, &TextEditorWidget::tooltipRequested, editor, [editor](const QPoint &globalPos, int position) { editor->tooltipRequested(editor, globalPos, position); }); - connect(widget, &BaseTextEditorWidget::markTooltipRequested, editor, + connect(widget, &TextEditorWidget::markTooltipRequested, editor, [editor](const QPoint &globalPos, int line) { editor->markTooltipRequested(editor, globalPos, line); }); - connect(widget, &BaseTextEditorWidget::activateEditor, + connect(widget, &TextEditorWidget::activateEditor, [editor]() { Core::EditorManager::activateEditor(editor); }); - connect(widget, &BaseTextEditorWidget::clearContentsHelpId, + connect(widget, &TextEditorWidget::clearContentsHelpId, [editor]() { editor->setContextHelpId(QString()); }); widget->finalizeInitialization(); diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 82172e828ba..2351ac6711e 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -73,14 +73,14 @@ typedef QList<RefactorMarker> RefactorMarkers; namespace Internal { class BaseTextEditorPrivate; - class BaseTextEditorWidgetPrivate; + class TextEditorWidgetPrivate; class TextEditorOverlay; } class AutoCompleter; class BaseTextEditor; -class BaseTextEditorFactory; -class BaseTextEditorWidget; +class TextEditorFactory; +class TextEditorWidget; class PlainTextEditorFactory; class BehaviorSettings; @@ -137,7 +137,7 @@ public: static BaseTextEditor *currentTextEditor(); - BaseTextEditorWidget *editorWidget() const; + TextEditorWidget *editorWidget() const; TextDocument *textDocument() const; // Some convenience text access @@ -201,24 +201,24 @@ signals: void contextHelpIdRequested(TextEditor::BaseTextEditor *editor, int position); private: - friend class BaseTextEditorFactory; + friend class TextEditorFactory; Internal::BaseTextEditorPrivate *d; }; -class TEXTEDITOR_EXPORT BaseTextEditorWidget : public QPlainTextEdit +class TEXTEDITOR_EXPORT TextEditorWidget : public QPlainTextEdit { Q_OBJECT Q_PROPERTY(int verticalBlockSelectionFirstColumn READ verticalBlockSelectionFirstColumn) Q_PROPERTY(int verticalBlockSelectionLastColumn READ verticalBlockSelectionLastColumn) public: - BaseTextEditorWidget(QWidget *parent = 0); - ~BaseTextEditorWidget(); + TextEditorWidget(QWidget *parent = 0); + ~TextEditorWidget(); - void setTextDocument(const BaseTextDocumentPtr &doc); + void setTextDocument(const TextDocumentPtr &doc); TextDocument *textDocument() const; - BaseTextDocumentPtr textDocumentPtr() const; + TextDocumentPtr textDocumentPtr() const; // IEditor virtual bool open(QString *errorString, const QString &fileName, const QString &realFileName); @@ -529,7 +529,7 @@ protected: void showDefaultContextMenu(QContextMenuEvent *e, Core::Id menuContextId); virtual void finalizeInitialization() {} - virtual void finalizeInitializationAfterDuplication(BaseTextEditorWidget *) {} + virtual void finalizeInitializationAfterDuplication(TextEditorWidget *) {} public: struct Link @@ -598,7 +598,7 @@ protected: signals: void markRequested(int line, TextEditor::BaseTextEditor::MarkRequestKind kind); void markContextMenuRequested(int line, QMenu *menu); - void tooltipOverrideRequested(TextEditor::BaseTextEditorWidget *editorWidget, + void tooltipOverrideRequested(TextEditor::TextEditorWidget *editorWidget, const QPoint &globalPos, int position, bool *handled); void tooltipRequested(const QPoint &globalPos, int position); void markTooltipRequested(const QPoint &globalPos, int line); @@ -612,24 +612,24 @@ protected slots: void doFoo(); private: - Internal::BaseTextEditorWidgetPrivate *d; + Internal::TextEditorWidgetPrivate *d; friend class BaseTextEditor; - friend class BaseTextEditorFactory; - friend class Internal::BaseTextEditorWidgetPrivate; + friend class TextEditorFactory; + friend class Internal::TextEditorWidgetPrivate; friend class Internal::TextEditorOverlay; friend class RefactorOverlay; }; -class TEXTEDITOR_EXPORT BaseTextEditorFactory : public Core::IEditorFactory +class TEXTEDITOR_EXPORT TextEditorFactory : public Core::IEditorFactory { Q_OBJECT public: - BaseTextEditorFactory(QObject *parent = 0); + TextEditorFactory(QObject *parent = 0); typedef std::function<BaseTextEditor *()> EditorCreator; typedef std::function<TextDocument *()> DocumentCreator; - typedef std::function<BaseTextEditorWidget *()> EditorWidgetCreator; + typedef std::function<TextEditorWidget *()> EditorWidgetCreator; typedef std::function<SyntaxHighlighter *()> SyntaxHighLighterCreator; typedef std::function<Indenter *()> IndenterCreator; typedef std::function<AutoCompleter *()> AutoCompleterCreator; @@ -654,7 +654,7 @@ private: friend class BaseTextEditor; friend class PlainTextEditorFactory; - BaseTextEditor *createEditorHelper(const BaseTextDocumentPtr &doc); + BaseTextEditor *createEditorHelper(const TextDocumentPtr &doc); BaseTextEditor *duplicateTextEditor(BaseTextEditor *); DocumentCreator m_documentCreator; @@ -669,6 +669,6 @@ private: } // namespace TextEditor -Q_DECLARE_METATYPE(TextEditor::BaseTextEditorWidget::Link) +Q_DECLARE_METATYPE(TextEditor::TextEditorWidget::Link) #endif // TEXTEDITOR_H diff --git a/src/plugins/texteditor/texteditor_p.h b/src/plugins/texteditor/texteditor_p.h index 21c92d91c11..29bc6b529af 100644 --- a/src/plugins/texteditor/texteditor_p.h +++ b/src/plugins/texteditor/texteditor_p.h @@ -55,13 +55,13 @@ namespace Internal { class TextEditorOverlay; class ClipboardAssistProvider; -class TEXTEDITOR_EXPORT BaseTextBlockSelection +class TEXTEDITOR_EXPORT TextBlockSelection { public: - BaseTextBlockSelection() + TextBlockSelection() : positionBlock(0), positionColumn(0) , anchorBlock(0) , anchorColumn(0){} - BaseTextBlockSelection(const BaseTextBlockSelection &other); + TextBlockSelection(const TextBlockSelection &other); void clear(); QTextCursor selection(const TextDocument *baseTextDocument) const; @@ -88,22 +88,23 @@ private: QTextCursor cursor(const TextDocument *baseTextDocument, bool fullSelection) const; }; -//================BaseTextEditorPrivate============== +// +// TextEditorPrivate +// -struct BaseTextEditorPrivateHighlightBlocks +struct TextEditorPrivateHighlightBlocks { QList<int> open; QList<int> close; QList<int> visualIndent; inline int count() const { return visualIndent.size(); } inline bool isEmpty() const { return open.isEmpty() || close.isEmpty() || visualIndent.isEmpty(); } - inline bool operator==(const BaseTextEditorPrivateHighlightBlocks &o) const { + inline bool operator==(const TextEditorPrivateHighlightBlocks &o) const { return (open == o.open && close == o.close && visualIndent == o.visualIndent); } - inline bool operator!=(const BaseTextEditorPrivateHighlightBlocks &o) const { return !(*this == o); } + inline bool operator!=(const TextEditorPrivateHighlightBlocks &o) const { return !(*this == o); } }; - } // namespace Internal } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditor_test.cpp b/src/plugins/texteditor/texteditor_test.cpp index d5757800a3a..aaf5f22e0e6 100644 --- a/src/plugins/texteditor/texteditor_test.cpp +++ b/src/plugins/texteditor/texteditor_test.cpp @@ -131,7 +131,7 @@ void Internal::TextEditorPlugin::testBlockSelectionTransformation() Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, 0, input.toLatin1()); QVERIFY(editor); if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor*>(editor)) { - BaseTextEditorWidget *editorWidget = textEditor->editorWidget(); + TextEditorWidget *editorWidget = textEditor->editorWidget(); editorWidget->setBlockSelection(selection.positionBlock, selection.positionColumn, selection.anchorBlock, @@ -354,7 +354,7 @@ void Internal::TextEditorPlugin::testBlockSelectionInsert() Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, 0, text); QVERIFY(editor); if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor*>(editor)) { - BaseTextEditorWidget *editorWidget = textEditor->editorWidget(); + TextEditorWidget *editorWidget = textEditor->editorWidget(); editorWidget->setBlockSelection(selection.positionBlock, selection.positionColumn, selection.anchorBlock, @@ -432,7 +432,7 @@ void Internal::TextEditorPlugin::testBlockSelectionRemove() Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, 0, text); QVERIFY(editor); if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor*>(editor)) { - BaseTextEditorWidget *editorWidget = textEditor->editorWidget(); + TextEditorWidget *editorWidget = textEditor->editorWidget(); editorWidget->setBlockSelection(selection.positionBlock, selection.positionColumn, selection.anchorBlock, @@ -487,7 +487,7 @@ void Internal::TextEditorPlugin::testBlockSelectionCopy() Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, 0, text); QVERIFY(editor); if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor*>(editor)) { - BaseTextEditorWidget *editorWidget = textEditor->editorWidget(); + TextEditorWidget *editorWidget = textEditor->editorWidget(); editorWidget->setBlockSelection(selection.positionBlock, selection.positionColumn, selection.anchorBlock, diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 3fe04f3fec6..d1a9a213456 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -76,7 +76,7 @@ public: } QAction *registerAction(Core::Id id, - std::function<void(BaseTextEditorWidget *)> slot, + std::function<void(TextEditorWidget *)> slot, bool scriptable = false, const QString &title = QString(), const QKeySequence &keySequence = QKeySequence(), @@ -88,7 +88,7 @@ public: } QAction *registerBoolAction(Core::Id id, - std::function<void(BaseTextEditorWidget *, bool)> slot, + std::function<void(TextEditorWidget *, bool)> slot, bool scriptable = false, const QString &title = QString(), const QKeySequence &keySequence = QKeySequence(), @@ -100,7 +100,7 @@ public: } QAction *registerIntAction(Core::Id id, - std::function<void(BaseTextEditorWidget *, int)> slot, + std::function<void(TextEditorWidget *, int)> slot, bool scriptable = false, const QString &title = QString(), const QKeySequence &keySequence = QKeySequence(), @@ -180,7 +180,7 @@ public: QList<QAction *> m_modifyingActions; uint m_optionalActions; - QPointer<BaseTextEditorWidget> m_currentEditorWidget; + QPointer<TextEditorWidget> m_currentEditorWidget; Core::Id m_contextId; }; @@ -256,18 +256,18 @@ void TextEditorActionHandlerPrivate::createActions() using namespace TextEditor::Constants; m_undoAction = registerAction(UNDO, - [this] (BaseTextEditorWidget *w) { w->undo(); }, true, tr("&Undo")); + [this] (TextEditorWidget *w) { w->undo(); }, true, tr("&Undo")); m_redoAction = registerAction(REDO, - [this] (BaseTextEditorWidget *w) { w->redo(); }, true, tr("&Redo")); + [this] (TextEditorWidget *w) { w->redo(); }, true, tr("&Redo")); m_copyAction = registerAction(COPY, - [this] (BaseTextEditorWidget *w) { w->copy(); }, true); + [this] (TextEditorWidget *w) { w->copy(); }, true); m_cutAction = registerAction(CUT, - [this] (BaseTextEditorWidget *w) { w->cut(); }, true); + [this] (TextEditorWidget *w) { w->cut(); }, true); m_pasteAction = registerAction(PASTE, - [this] (BaseTextEditorWidget *w) { w->paste(); }, true); + [this] (TextEditorWidget *w) { w->paste(); }, true); m_selectAllAction = registerAction(SELECTALL, - [this] (BaseTextEditorWidget *w) { w->selectAll(); }, true); - m_gotoAction = registerAction(GOTO, [this] (BaseTextEditorWidget *) { + [this] (TextEditorWidget *w) { w->selectAll(); }, true); + m_gotoAction = registerAction(GOTO, [this] (TextEditorWidget *) { QString locatorString = TextEditorPlugin::lineNumberFilter()->shortcutString(); locatorString += QLatin1Char(' '); const int selectionStart = locatorString.size(); @@ -275,97 +275,97 @@ void TextEditorActionHandlerPrivate::createActions() Core::LocatorManager::show(locatorString, selectionStart, locatorString.size() - selectionStart); }); m_printAction = registerAction(PRINT, - [this] (BaseTextEditorWidget *widget) { widget->print(Core::ICore::printer()); }); + [this] (TextEditorWidget *widget) { widget->print(Core::ICore::printer()); }); m_deleteLineAction = registerAction(DELETE_LINE, - [this] (BaseTextEditorWidget *w) { w->deleteLine(); }, true, tr("Delete &Line")); + [this] (TextEditorWidget *w) { w->deleteLine(); }, true, tr("Delete &Line")); m_deleteEndOfWordAction = registerAction(DELETE_END_OF_WORD, - [this] (BaseTextEditorWidget *w) { w->deleteEndOfWord(); }, true, tr("Delete Word from Cursor On")); + [this] (TextEditorWidget *w) { w->deleteEndOfWord(); }, true, tr("Delete Word from Cursor On")); m_deleteEndOfWordCamelCaseAction = registerAction(DELETE_END_OF_WORD_CAMEL_CASE, - [this] (BaseTextEditorWidget *w) { w->deleteEndOfWordCamelCase(); }, true, tr("Delete Word Camel Case from Cursor On")); + [this] (TextEditorWidget *w) { w->deleteEndOfWordCamelCase(); }, true, tr("Delete Word Camel Case from Cursor On")); m_deleteStartOfWordAction = registerAction(DELETE_START_OF_WORD, - [this] (BaseTextEditorWidget *w) { w->deleteStartOfWord(); }, true, tr("Delete Word up to Cursor")); + [this] (TextEditorWidget *w) { w->deleteStartOfWord(); }, true, tr("Delete Word up to Cursor")); m_deleteStartOfWordCamelCaseAction = registerAction(DELETE_START_OF_WORD_CAMEL_CASE, - [this] (BaseTextEditorWidget *w) { w->deleteStartOfWordCamelCase(); }, true, tr("Delete Word Camel Case up to Cursor")); + [this] (TextEditorWidget *w) { w->deleteStartOfWordCamelCase(); }, true, tr("Delete Word Camel Case up to Cursor")); m_gotoBlockStartWithSelectionAction = registerAction(GOTO_BLOCK_START_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoBlockStartWithSelection(); }, true, tr("Go to Block Start with Selection"), + [this] (TextEditorWidget *w) { w->gotoBlockStartWithSelection(); }, true, tr("Go to Block Start with Selection"), QKeySequence(tr("Ctrl+{"))); m_gotoBlockEndWithSelectionAction = registerAction(GOTO_BLOCK_END_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoBlockEndWithSelection(); }, true, tr("Go to Block End with Selection"), + [this] (TextEditorWidget *w) { w->gotoBlockEndWithSelection(); }, true, tr("Go to Block End with Selection"), QKeySequence(tr("Ctrl+}"))); m_moveLineUpAction = registerAction(MOVE_LINE_UP, - [this] (BaseTextEditorWidget *w) { w->moveLineUp(); }, true, tr("Move Line Up"), + [this] (TextEditorWidget *w) { w->moveLineUp(); }, true, tr("Move Line Up"), QKeySequence(tr("Ctrl+Shift+Up"))); m_moveLineDownAction = registerAction(MOVE_LINE_DOWN, - [this] (BaseTextEditorWidget *w) { w->moveLineDown(); }, true, tr("Move Line Down"), + [this] (TextEditorWidget *w) { w->moveLineDown(); }, true, tr("Move Line Down"), QKeySequence(tr("Ctrl+Shift+Down"))); m_copyLineUpAction = registerAction(COPY_LINE_UP, - [this] (BaseTextEditorWidget *w) { w->copyLineUp(); }, true, tr("Copy Line Up"), + [this] (TextEditorWidget *w) { w->copyLineUp(); }, true, tr("Copy Line Up"), QKeySequence(tr("Ctrl+Alt+Up"))); m_copyLineDownAction = registerAction(COPY_LINE_DOWN, - [this] (BaseTextEditorWidget *w) { w->copyLineDown(); }, true, tr("Copy Line Down"), + [this] (TextEditorWidget *w) { w->copyLineDown(); }, true, tr("Copy Line Down"), QKeySequence(tr("Ctrl+Alt+Down"))); m_joinLinesAction = registerAction(JOIN_LINES, - [this] (BaseTextEditorWidget *w) { w->joinLines(); }, true, tr("Join Lines"), + [this] (TextEditorWidget *w) { w->joinLines(); }, true, tr("Join Lines"), QKeySequence(tr("Ctrl+J"))); m_insertLineAboveAction = registerAction(INSERT_LINE_ABOVE, - [this] (BaseTextEditorWidget *w) { w->insertLineAbove(); }, true, tr("Insert Line Above Current Line"), + [this] (TextEditorWidget *w) { w->insertLineAbove(); }, true, tr("Insert Line Above Current Line"), QKeySequence(tr("Ctrl+Shift+Return"))); m_insertLineBelowAction = registerAction(INSERT_LINE_BELOW, - [this] (BaseTextEditorWidget *w) { w->insertLineBelow(); }, true, tr("Insert Line Below Current Line"), + [this] (TextEditorWidget *w) { w->insertLineBelow(); }, true, tr("Insert Line Below Current Line"), QKeySequence(tr("Ctrl+Return"))); m_switchUtf8bomAction = registerAction(SWITCH_UTF8BOM, - [this] (BaseTextEditorWidget *w) { w->switchUtf8bom(); }, true); + [this] (TextEditorWidget *w) { w->switchUtf8bom(); }, true); m_indentAction = registerAction(INDENT, - [this] (BaseTextEditorWidget *w) { w->indent(); }, true, tr("Indent")); + [this] (TextEditorWidget *w) { w->indent(); }, true, tr("Indent")); m_unindentAction = registerAction(UNINDENT, - [this] (BaseTextEditorWidget *w) { w->unindent(); }, true, tr("Unindent")); + [this] (TextEditorWidget *w) { w->unindent(); }, true, tr("Unindent")); m_followSymbolAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR, - [this] (BaseTextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Follow Symbol Under Cursor"), + [this] (TextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Follow Symbol Under Cursor"), QKeySequence(Qt::Key_F2)); m_followSymbolInNextSplitAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT, - [this] (BaseTextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, tr("Follow Symbol Under Cursor in Next Split"), + [this] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, tr("Follow Symbol Under Cursor in Next Split"), QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2"))); m_jumpToFileAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR, - [this] (BaseTextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Jump To File Under Cursor"), + [this] (TextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Jump To File Under Cursor"), QKeySequence(Qt::Key_F2)); m_jumpToFileInNextSplitAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR_IN_NEXT_SPLIT, - [this] (BaseTextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, + [this] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2")).toString()); m_viewPageUpAction = registerAction(VIEW_PAGE_UP, - [this] (BaseTextEditorWidget *w) { w->viewPageUp(); }, true, tr("Move the View a Page Up and Keep the Cursor Position"), + [this] (TextEditorWidget *w) { w->viewPageUp(); }, true, tr("Move the View a Page Up and Keep the Cursor Position"), QKeySequence(tr("Ctrl+PgUp"))); m_viewPageDownAction = registerAction(VIEW_PAGE_DOWN, - [this] (BaseTextEditorWidget *w) { w->viewPageDown(); }, true, tr("Move the View a Page Down and Keep the Cursor Position"), + [this] (TextEditorWidget *w) { w->viewPageDown(); }, true, tr("Move the View a Page Down and Keep the Cursor Position"), QKeySequence(tr("Ctrl+PgDown"))); m_viewLineUpAction = registerAction(VIEW_LINE_UP, - [this] (BaseTextEditorWidget *w) { w->viewLineUp(); }, true, tr("Move the View a Line Up and Keep the Cursor Position"), + [this] (TextEditorWidget *w) { w->viewLineUp(); }, true, tr("Move the View a Line Up and Keep the Cursor Position"), QKeySequence(tr("Ctrl+Up"))); m_viewLineDownAction = registerAction(VIEW_LINE_DOWN, - [this] (BaseTextEditorWidget *w) { w->viewLineDown(); }, true, tr("Move the View a Line Down and Keep the Cursor Position"), + [this] (TextEditorWidget *w) { w->viewLineDown(); }, true, tr("Move the View a Line Down and Keep the Cursor Position"), QKeySequence(tr("Ctrl+Down"))); // register "Edit" Menu Actions Core::ActionContainer *editMenu = Core::ActionManager::actionContainer(M_EDIT); m_selectEncodingAction = registerAction(SELECT_ENCODING, - [this] (BaseTextEditorWidget *w) { w->selectEncoding(); }, false, tr("Select Encoding..."), + [this] (TextEditorWidget *w) { w->selectEncoding(); }, false, tr("Select Encoding..."), QKeySequence(), G_EDIT_OTHER, editMenu); m_circularPasteAction = registerAction(CIRCULAR_PASTE, - [this] (BaseTextEditorWidget *w) { w->circularPaste(); }, false, tr("Paste from Clipboard History"), + [this] (TextEditorWidget *w) { w->circularPaste(); }, false, tr("Paste from Clipboard History"), QKeySequence(tr("Ctrl+Shift+V")), G_EDIT_COPYPASTE, editMenu); // register "Edit -> Advanced" Menu Actions Core::ActionContainer *advancedEditMenu = Core::ActionManager::actionContainer(M_EDIT_ADVANCED); m_formatAction = registerAction(AUTO_INDENT_SELECTION, - [this] (BaseTextEditorWidget *w) { w->format(); }, true, tr("Auto-&indent Selection"), + [this] (TextEditorWidget *w) { w->format(); }, true, tr("Auto-&indent Selection"), QKeySequence(tr("Ctrl+I")), G_EDIT_FORMAT, advancedEditMenu); m_rewrapParagraphAction = registerAction(REWRAP_PARAGRAPH, - [this] (BaseTextEditorWidget *w) { w->rewrapParagraph(); }, true, tr("&Rewrap Paragraph"), + [this] (TextEditorWidget *w) { w->rewrapParagraph(); }, true, tr("&Rewrap Paragraph"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, R") : tr("Ctrl+E, R")), G_EDIT_FORMAT, advancedEditMenu); m_visualizeWhitespaceAction = registerBoolAction(VISUALIZE_WHITESPACE, - [this] (BaseTextEditorWidget *widget, bool checked) { + [this] (TextEditorWidget *widget, bool checked) { if (widget) { DisplaySettings ds = widget->displaySettings(); ds.m_visualizeWhitespace = checked; @@ -377,11 +377,11 @@ void TextEditorActionHandlerPrivate::createActions() G_EDIT_FORMAT, advancedEditMenu); m_visualizeWhitespaceAction->setCheckable(true); m_cleanWhitespaceAction = registerAction(CLEAN_WHITESPACE, - [this] (BaseTextEditorWidget *w) { w->cleanWhitespace(); }, true, tr("Clean Whitespace"), + [this] (TextEditorWidget *w) { w->cleanWhitespace(); }, true, tr("Clean Whitespace"), QKeySequence(), G_EDIT_FORMAT, advancedEditMenu); m_textWrappingAction = registerBoolAction(TEXT_WRAPPING, - [this] (BaseTextEditorWidget *widget, bool checked) { + [this] (TextEditorWidget *widget, bool checked) { if (widget) { DisplaySettings ds = widget->displaySettings(); ds.m_textWrapping = checked; @@ -393,109 +393,109 @@ void TextEditorActionHandlerPrivate::createActions() G_EDIT_FORMAT, advancedEditMenu); m_textWrappingAction->setCheckable(true); m_unCommentSelectionAction = registerAction(UN_COMMENT_SELECTION, - [this] (BaseTextEditorWidget *w) { w->unCommentSelection(); }, true, tr("Toggle Comment &Selection"), + [this] (TextEditorWidget *w) { w->unCommentSelection(); }, true, tr("Toggle Comment &Selection"), QKeySequence(tr("Ctrl+/")), G_EDIT_FORMAT, advancedEditMenu); m_cutLineAction = registerAction(CUT_LINE, - [this] (BaseTextEditorWidget *w) { w->cutLine(); }, true, tr("Cut &Line"), + [this] (TextEditorWidget *w) { w->cutLine(); }, true, tr("Cut &Line"), QKeySequence(tr("Shift+Del")), G_EDIT_TEXT, advancedEditMenu); m_copyLineAction = registerAction(COPY_LINE, - [this] (BaseTextEditorWidget *w) { w->copyLine(); }, false, tr("Copy &Line"), + [this] (TextEditorWidget *w) { w->copyLine(); }, false, tr("Copy &Line"), QKeySequence(tr("Ctrl+Ins")), G_EDIT_TEXT, advancedEditMenu); m_upperCaseSelectionAction = registerAction(UPPERCASE_SELECTION, - [this] (BaseTextEditorWidget *w) { w->uppercaseSelection(); }, true, tr("Uppercase Selection"), + [this] (TextEditorWidget *w) { w->uppercaseSelection(); }, true, tr("Uppercase Selection"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+U") : tr("Alt+Shift+U")), G_EDIT_TEXT, advancedEditMenu); m_lowerCaseSelectionAction = registerAction(LOWERCASE_SELECTION, - [this] (BaseTextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"), + [this] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+U") : tr("Alt+U")), G_EDIT_TEXT, advancedEditMenu); m_foldAction = registerAction(FOLD, - [this] (BaseTextEditorWidget *w) { w->fold(); }, true, tr("Fold"), + [this] (TextEditorWidget *w) { w->fold(); }, true, tr("Fold"), QKeySequence(tr("Ctrl+<")), G_EDIT_COLLAPSING, advancedEditMenu); m_unfoldAction = registerAction(UNFOLD, - [this] (BaseTextEditorWidget *w) { w->unfold(); }, true, tr("Unfold"), + [this] (TextEditorWidget *w) { w->unfold(); }, true, tr("Unfold"), QKeySequence(tr("Ctrl+>")), G_EDIT_COLLAPSING, advancedEditMenu); m_unfoldAllAction = registerAction(UNFOLD_ALL, - [this] (BaseTextEditorWidget *w) { w->unfoldAll(); }, true, tr("Toggle &Fold All"), + [this] (TextEditorWidget *w) { w->unfoldAll(); }, true, tr("Toggle &Fold All"), QKeySequence(), G_EDIT_COLLAPSING, advancedEditMenu); m_increaseFontSizeAction = registerAction(INCREASE_FONT_SIZE, - [this] (BaseTextEditorWidget *w) { w->zoomIn(); }, false, tr("Increase Font Size"), + [this] (TextEditorWidget *w) { w->zoomIn(); }, false, tr("Increase Font Size"), QKeySequence(tr("Ctrl++")), G_EDIT_FONT, advancedEditMenu); m_decreaseFontSizeAction = registerAction(DECREASE_FONT_SIZE, - [this] (BaseTextEditorWidget *w) { w->zoomOut(); }, false, tr("Decrease Font Size"), + [this] (TextEditorWidget *w) { w->zoomOut(); }, false, tr("Decrease Font Size"), QKeySequence(tr("Ctrl+-")), G_EDIT_FONT, advancedEditMenu); m_resetFontSizeAction = registerAction(RESET_FONT_SIZE, - [this] (BaseTextEditorWidget *w) { w->zoomReset(); }, false, tr("Reset Font Size"), + [this] (TextEditorWidget *w) { w->zoomReset(); }, false, tr("Reset Font Size"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")), G_EDIT_FONT, advancedEditMenu); m_gotoBlockStartAction = registerAction(GOTO_BLOCK_START, - [this] (BaseTextEditorWidget *w) { w->gotoBlockStart(); }, true, tr("Go to Block Start"), + [this] (TextEditorWidget *w) { w->gotoBlockStart(); }, true, tr("Go to Block Start"), QKeySequence(tr("Ctrl+[")), G_EDIT_BLOCKS, advancedEditMenu); m_gotoBlockEndAction = registerAction(GOTO_BLOCK_END, - [this] (BaseTextEditorWidget *w) { w->gotoBlockEnd(); }, true, tr("Go to Block End"), + [this] (TextEditorWidget *w) { w->gotoBlockEnd(); }, true, tr("Go to Block End"), QKeySequence(tr("Ctrl+]")), G_EDIT_BLOCKS, advancedEditMenu); m_selectBlockUpAction = registerAction(SELECT_BLOCK_UP, - [this] (BaseTextEditorWidget *w) { w->selectBlockUp(); }, true, tr("Select Block Up"), + [this] (TextEditorWidget *w) { w->selectBlockUp(); }, true, tr("Select Block Up"), QKeySequence(tr("Ctrl+U")), G_EDIT_BLOCKS, advancedEditMenu); m_selectBlockDownAction = registerAction(SELECT_BLOCK_DOWN, - [this] (BaseTextEditorWidget *w) { w->selectBlockDown(); }, true, tr("Select Block Down"), + [this] (TextEditorWidget *w) { w->selectBlockDown(); }, true, tr("Select Block Down"), QKeySequence(), G_EDIT_BLOCKS, advancedEditMenu); // register GOTO Actions registerAction(GOTO_LINE_START, - [this] (BaseTextEditorWidget *w) { w->gotoLineStart(); }, true, tr("Go to Line Start")); + [this] (TextEditorWidget *w) { w->gotoLineStart(); }, true, tr("Go to Line Start")); registerAction(GOTO_LINE_END, - [this] (BaseTextEditorWidget *w) { w->gotoLineEnd(); }, true, tr("Go to Line End")); + [this] (TextEditorWidget *w) { w->gotoLineEnd(); }, true, tr("Go to Line End")); registerAction(GOTO_NEXT_LINE, - [this] (BaseTextEditorWidget *w) { w->gotoNextLine(); }, true, tr("Go to Next Line")); + [this] (TextEditorWidget *w) { w->gotoNextLine(); }, true, tr("Go to Next Line")); registerAction(GOTO_PREVIOUS_LINE, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousLine(); }, true, tr("Go to Previous Line")); + [this] (TextEditorWidget *w) { w->gotoPreviousLine(); }, true, tr("Go to Previous Line")); registerAction(GOTO_PREVIOUS_CHARACTER, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousCharacter(); }, true, tr("Go to Previous Character")); + [this] (TextEditorWidget *w) { w->gotoPreviousCharacter(); }, true, tr("Go to Previous Character")); registerAction(GOTO_NEXT_CHARACTER, - [this] (BaseTextEditorWidget *w) { w->gotoNextCharacter(); }, true, tr("Go to Next Character")); + [this] (TextEditorWidget *w) { w->gotoNextCharacter(); }, true, tr("Go to Next Character")); registerAction(GOTO_PREVIOUS_WORD, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousWord(); }, true, tr("Go to Previous Word")); + [this] (TextEditorWidget *w) { w->gotoPreviousWord(); }, true, tr("Go to Previous Word")); registerAction(GOTO_NEXT_WORD, - [this] (BaseTextEditorWidget *w) { w->gotoNextWord(); }, true, tr("Go to Next Word")); + [this] (TextEditorWidget *w) { w->gotoNextWord(); }, true, tr("Go to Next Word")); registerAction(GOTO_PREVIOUS_WORD_CAMEL_CASE, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousWordCamelCase(); }, false, tr("Go to Previous Word Camel Case")); + [this] (TextEditorWidget *w) { w->gotoPreviousWordCamelCase(); }, false, tr("Go to Previous Word Camel Case")); registerAction(GOTO_NEXT_WORD_CAMEL_CASE, - [this] (BaseTextEditorWidget *w) { w->gotoNextWordCamelCase(); }, false, tr("Go to Next Word Camel Case")); + [this] (TextEditorWidget *w) { w->gotoNextWordCamelCase(); }, false, tr("Go to Next Word Camel Case")); // register GOTO actions with selection registerAction(GOTO_LINE_START_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoLineStartWithSelection(); }, true, tr("Go to Line Start with Selection")); + [this] (TextEditorWidget *w) { w->gotoLineStartWithSelection(); }, true, tr("Go to Line Start with Selection")); registerAction(GOTO_LINE_END_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoLineEndWithSelection(); }, true, tr("Go to Line End with Selection")); + [this] (TextEditorWidget *w) { w->gotoLineEndWithSelection(); }, true, tr("Go to Line End with Selection")); registerAction(GOTO_NEXT_LINE_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoNextLineWithSelection(); }, true, tr("Go to Next Line with Selection")); + [this] (TextEditorWidget *w) { w->gotoNextLineWithSelection(); }, true, tr("Go to Next Line with Selection")); registerAction(GOTO_PREVIOUS_LINE_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousLineWithSelection(); }, true, tr("Go to Previous Line with Selection")); + [this] (TextEditorWidget *w) { w->gotoPreviousLineWithSelection(); }, true, tr("Go to Previous Line with Selection")); registerAction(GOTO_PREVIOUS_CHARACTER_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousCharacterWithSelection(); }, true, tr("Go to Previous Character with Selection")); + [this] (TextEditorWidget *w) { w->gotoPreviousCharacterWithSelection(); }, true, tr("Go to Previous Character with Selection")); registerAction(GOTO_NEXT_CHARACTER_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoNextCharacterWithSelection(); }, true, tr("Go to Next Character with Selection")); + [this] (TextEditorWidget *w) { w->gotoNextCharacterWithSelection(); }, true, tr("Go to Next Character with Selection")); registerAction(GOTO_PREVIOUS_WORD_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousWordWithSelection(); }, true, tr("Go to Previous Word with Selection")); + [this] (TextEditorWidget *w) { w->gotoPreviousWordWithSelection(); }, true, tr("Go to Previous Word with Selection")); registerAction(GOTO_NEXT_WORD_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoNextWordWithSelection(); }, true, tr("Go to Next Word with Selection")); + [this] (TextEditorWidget *w) { w->gotoNextWordWithSelection(); }, true, tr("Go to Next Word with Selection")); registerAction(GOTO_PREVIOUS_WORD_CAMEL_CASE_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoPreviousWordCamelCaseWithSelection(); }, false, tr("Go to Previous Word Camel Case with Selection")); + [this] (TextEditorWidget *w) { w->gotoPreviousWordCamelCaseWithSelection(); }, false, tr("Go to Previous Word Camel Case with Selection")); registerAction(GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION, - [this] (BaseTextEditorWidget *w) { w->gotoNextWordCamelCaseWithSelection(); }, false, tr("Go to Next Word Camel Case with Selection")); + [this] (TextEditorWidget *w) { w->gotoNextWordCamelCaseWithSelection(); }, false, tr("Go to Next Word Camel Case with Selection")); // Collect all modifying actions so we can check for them inside a readonly file // and disable them @@ -578,7 +578,7 @@ void TextEditorActionHandlerPrivate::updateCurrentEditor(Core::IEditor *editor) if (!editor || !editor->context().contains(m_contextId)) return; - BaseTextEditorWidget *editorWidget = q->resolveTextEditorWidget(editor); + TextEditorWidget *editorWidget = q->resolveTextEditorWidget(editor); QTC_ASSERT(editorWidget, return); // editor has our context id, so shouldn't happen m_currentEditorWidget = editorWidget; connect(editorWidget, &QPlainTextEdit::undoAvailable, @@ -587,7 +587,7 @@ void TextEditorActionHandlerPrivate::updateCurrentEditor(Core::IEditor *editor) this, &TextEditorActionHandlerPrivate::updateRedoAction); connect(editorWidget, &QPlainTextEdit::copyAvailable, this, &TextEditorActionHandlerPrivate::updateCopyAction); - connect(editorWidget, &BaseTextEditorWidget::readOnlyChanged, + connect(editorWidget, &TextEditorWidget::readOnlyChanged, this, &TextEditorActionHandlerPrivate::updateActions); updateActions(); } @@ -604,9 +604,9 @@ TextEditorActionHandler::~TextEditorActionHandler() delete d; } -BaseTextEditorWidget *TextEditorActionHandler::resolveTextEditorWidget(Core::IEditor *editor) const +TextEditorWidget *TextEditorActionHandler::resolveTextEditorWidget(Core::IEditor *editor) const { - return qobject_cast<BaseTextEditorWidget *>(editor->widget()); + return qobject_cast<TextEditorWidget *>(editor->widget()); } } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index 3006faf455f..d902583d768 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -39,7 +39,7 @@ namespace Core { class IEditor; } namespace TextEditor { -class BaseTextEditorWidget; +class TextEditorWidget; namespace Internal { class TextEditorActionHandlerPrivate; } @@ -63,7 +63,7 @@ public: ~TextEditorActionHandler(); protected: - virtual BaseTextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const; + virtual TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const; private: friend class Internal::TextEditorActionHandlerPrivate; diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 9664e99c822..d6868cb75a1 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -39,7 +39,7 @@ using namespace TextEditor; using namespace TextEditor::Internal; -TextEditorOverlay::TextEditorOverlay(BaseTextEditorWidget *editor) : +TextEditorOverlay::TextEditorOverlay(TextEditorWidget *editor) : QObject(editor), m_visible(false), m_alpha(true), diff --git a/src/plugins/texteditor/texteditoroverlay.h b/src/plugins/texteditor/texteditoroverlay.h index 7115d4498d0..b971240b439 100644 --- a/src/plugins/texteditor/texteditoroverlay.h +++ b/src/plugins/texteditor/texteditoroverlay.h @@ -40,7 +40,7 @@ QT_FORWARD_DECLARE_CLASS(QWidget) namespace TextEditor { class NameMangler; -class BaseTextEditorWidget; +class TextEditorWidget; namespace Internal { @@ -60,7 +60,7 @@ class TextEditorOverlay : public QObject { Q_OBJECT public: - TextEditorOverlay(BaseTextEditorWidget *editor); + TextEditorOverlay(TextEditorWidget *editor); QRect rect() const; void paint(QPainter *painter, const QRect &clip); @@ -119,7 +119,7 @@ private: int m_borderWidth; int m_dropShadowWidth; int m_firstSelectionOriginalBegin; - BaseTextEditorWidget *m_editor; + TextEditorWidget *m_editor; QWidget *m_viewport; QList<OverlaySelection> m_selections; QVector<QList<int> > m_equivalentSelections; diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index 73a33b9c408..60929b3d2c2 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -72,7 +72,7 @@ VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters, return document; }); - setEditorWidgetCreator([=]() -> BaseTextEditorWidget* { + setEditorWidgetCreator([=]() -> TextEditorWidget* { auto widget = qobject_cast<VcsBaseEditorWidget *>(editorWidgetCreator()); widget->setDescribeSlot(describeReceiver, describeSlot); widget->setParameters(parameters); diff --git a/src/plugins/vcsbase/basevcseditorfactory.h b/src/plugins/vcsbase/basevcseditorfactory.h index 86d3e8ed556..b4cd8069c17 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.h +++ b/src/plugins/vcsbase/basevcseditorfactory.h @@ -37,7 +37,7 @@ namespace VcsBase { -class VCSBASE_EXPORT VcsEditorFactory : public TextEditor::BaseTextEditorFactory +class VCSBASE_EXPORT VcsEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index ed961c514e1..77b9844fe1d 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -553,7 +553,7 @@ public: // Can be used for diff and log. Combo created on first call. QComboBox *entriesComboBox(); - BaseTextEditorWidget *q; + TextEditorWidget *q; const VcsBaseEditorParameters *m_parameters; QString m_workingDirectory; @@ -615,7 +615,7 @@ QComboBox *VcsBaseEditorWidgetPrivate::entriesComboBox() policy.setHorizontalPolicy(QSizePolicy::Expanding); m_entriesComboBox->setSizePolicy(policy); - q->insertExtraToolBarWidget(BaseTextEditorWidget::Left, m_entriesComboBox); + q->insertExtraToolBarWidget(TextEditorWidget::Left, m_entriesComboBox); return m_entriesComboBox; } @@ -978,7 +978,7 @@ void VcsBaseEditorWidget::mouseMoveEvent(QMouseEvent *e) { if (e->buttons()) { d->m_mouseDragging = true; - BaseTextEditorWidget::mouseMoveEvent(e); + TextEditorWidget::mouseMoveEvent(e); return; } @@ -999,7 +999,7 @@ void VcsBaseEditorWidget::mouseMoveEvent(QMouseEvent *e) cursorShape = Qt::IBeamCursor; } } - BaseTextEditorWidget::mouseMoveEvent(e); + TextEditorWidget::mouseMoveEvent(e); if (overrideCursor) viewport()->setCursor(cursorShape); @@ -1020,7 +1020,7 @@ void VcsBaseEditorWidget::mouseReleaseEvent(QMouseEvent *e) } } } - BaseTextEditorWidget::mouseReleaseEvent(e); + TextEditorWidget::mouseReleaseEvent(e); } void VcsBaseEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) @@ -1029,7 +1029,7 @@ void VcsBaseEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) QTextCursor cursor = cursorForPosition(e->pos()); jumpToChangeFromDiff(cursor); } - BaseTextEditorWidget::mouseDoubleClickEvent(e); + TextEditorWidget::mouseDoubleClickEvent(e); } void VcsBaseEditorWidget::keyPressEvent(QKeyEvent *e) @@ -1039,7 +1039,7 @@ void VcsBaseEditorWidget::keyPressEvent(QKeyEvent *e) jumpToChangeFromDiff(textCursor()); return; } - BaseTextEditorWidget::keyPressEvent(e); + TextEditorWidget::keyPressEvent(e); } void VcsBaseEditorWidget::slotActivateAnnotation() @@ -1339,7 +1339,7 @@ bool VcsBaseEditorWidget::setConfigurationWidget(VcsBaseEditorParameterWidget *w return false; d->m_configurationWidget = w; - insertExtraToolBarWidget(BaseTextEditorWidget::Right, w); + insertExtraToolBarWidget(TextEditorWidget::Right, w); return true; } diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index 96e7f53cdf1..e6b328767cb 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -138,7 +138,7 @@ signals: const QString &change, int line); }; -class VCSBASE_EXPORT VcsBaseEditorWidget : public TextEditor::BaseTextEditorWidget +class VCSBASE_EXPORT VcsBaseEditorWidget : public TextEditor::TextEditorWidget { Q_PROPERTY(QString source READ source WRITE setSource) Q_PROPERTY(QString workingDirectory READ workingDirectory WRITE setWorkingDirectory) -- GitLab