TextEditor: Rename BaseTextEditorWidget to TextEditorWidget

... and some of the related implementation details

Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
hjk
2014-09-26 11:37:54 +02:00
committed by David Schulz
parent cfaa30d0b9
commit 10c8d5f0ca
137 changed files with 825 additions and 827 deletions
+3 -3
View File
@@ -37,7 +37,7 @@
#include <qmljs/qmljsdocument.h> #include <qmljs/qmljsdocument.h>
#include <qmljs/parser/qmljsastfwd_p.h> #include <qmljs/parser/qmljsastfwd_p.h>
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace QmlJS { namespace QmlJS {
@@ -50,9 +50,9 @@ class QMLJS_EXPORT IContextPane : public QObject
public: public:
IContextPane(QObject *parent = 0) : QObject(parent) {} IContextPane(QObject *parent = 0) : QObject(parent) {}
virtual ~IContextPane() {} 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 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; virtual QWidget* widget() = 0;
signals: signals:
void closed(); void closed();
@@ -84,7 +84,7 @@ Core::IDocument *AndroidManifestEditor::document()
return textEditor()->textDocument(); return textEditor()->textDocument();
} }
TextEditor::BaseTextEditorWidget *AndroidManifestEditor::textEditor() const TextEditor::TextEditorWidget *AndroidManifestEditor::textEditor() const
{ {
return widget()->textEditorWidget(); return widget()->textEditorWidget();
} }
+1 -1
View File
@@ -54,7 +54,7 @@ public:
QWidget *toolBar(); QWidget *toolBar();
AndroidManifestEditorWidget *widget() const; AndroidManifestEditorWidget *widget() const;
Core::IDocument *document(); Core::IDocument *document();
TextEditor::BaseTextEditorWidget *textEditor() const; TextEditor::TextEditorWidget *textEditor() const;
int currentLine() const; int currentLine() const;
int currentColumn() const; int currentColumn() const;
@@ -46,7 +46,7 @@ public:
: TextEditorActionHandler(parent, Constants::ANDROID_MANIFEST_EDITOR_CONTEXT) : TextEditorActionHandler(parent, Constants::ANDROID_MANIFEST_EDITOR_CONTEXT)
{} {}
private: private:
TextEditor::BaseTextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const TextEditor::TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const
{ {
AndroidManifestEditor *androidManifestEditor = static_cast<AndroidManifestEditor *>(editor); AndroidManifestEditor *androidManifestEditor = static_cast<AndroidManifestEditor *>(editor);
return androidManifestEditor->textEditor(); return androidManifestEditor->textEditor();
@@ -623,7 +623,7 @@ Core::IEditor *AndroidManifestEditorWidget::editor() const
return m_editor; return m_editor;
} }
TextEditor::BaseTextEditorWidget *AndroidManifestEditorWidget::textEditorWidget() const TextEditor::TextEditorWidget *AndroidManifestEditorWidget::textEditorWidget() const
{ {
return m_textEditorWidget; return m_textEditorWidget;
} }
@@ -1425,9 +1425,9 @@ int PermissionsModel::rowCount(const QModelIndex &parent) const
AndroidManifestTextEditorWidget::AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent) AndroidManifestTextEditorWidget::AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent)
: TextEditor::BaseTextEditorWidget(parent) : TextEditor::TextEditorWidget(parent)
{ {
setTextDocument(TextEditor::BaseTextDocumentPtr(new AndroidManifestDocument(parent))); setTextDocument(TextEditor::TextDocumentPtr(new AndroidManifestDocument(parent)));
setupAsPlainEditor(); setupAsPlainEditor();
textDocument()->setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE)); textDocument()->setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
} }
@@ -79,7 +79,7 @@ private:
QStringList m_permissions; QStringList m_permissions;
}; };
class AndroidManifestTextEditorWidget : public TextEditor::BaseTextEditorWidget class AndroidManifestTextEditorWidget : public TextEditor::TextEditorWidget
{ {
public: public:
explicit AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent); explicit AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent);
@@ -106,7 +106,7 @@ public:
void preSave(); void preSave();
Core::IEditor *editor() const; Core::IEditor *editor() const;
TextEditor::BaseTextEditorWidget *textEditorWidget() const; TextEditor::TextEditorWidget *textEditorWidget() const;
public slots: public slots:
void setDirty(bool dirty = true); void setDirty(bool dirty = true);
@@ -190,7 +190,7 @@ private:
QComboBox *m_permissionsComboBox; QComboBox *m_permissionsComboBox;
QTimer m_timerParseCheck; QTimer m_timerParseCheck;
TextEditor::BaseTextEditorWidget *m_textEditorWidget; TextEditor::TextEditorWidget *m_textEditorWidget;
QStackedWidget *m_stackedWidget; QStackedWidget *m_stackedWidget;
AndroidManifestEditor *m_editor; AndroidManifestEditor *m_editor;
}; };
+1 -1
View File
@@ -52,7 +52,7 @@ namespace Internal {
// JavaEditorWidget // JavaEditorWidget
// //
class JavaEditorWidget : public TextEditor::BaseTextEditorWidget class JavaEditorWidget : public TextEditor::TextEditorWidget
{ {
public: public:
JavaEditorWidget() JavaEditorWidget()
+1 -1
View File
@@ -35,7 +35,7 @@
namespace Android { namespace Android {
namespace Internal { namespace Internal {
class JavaEditorFactory : public TextEditor::BaseTextEditorFactory class JavaEditorFactory : public TextEditor::TextEditorFactory
{ {
Q_OBJECT Q_OBJECT
@@ -263,7 +263,7 @@ public:
{} {}
virtual bool isCorrective() const { return m_replaceDotForArrow; } virtual bool isCorrective() const { return m_replaceDotForArrow; }
virtual void makeCorrection(BaseTextEditorWidget *editorWidget) virtual void makeCorrection(TextEditorWidget *editorWidget)
{ {
editorWidget->setCursorPosition(basePosition() - 1); editorWidget->setCursorPosition(basePosition() - 1);
editorWidget->replace(1, QLatin1String("->")); editorWidget->replace(1, QLatin1String("->"));
@@ -351,7 +351,7 @@ public:
ClangAssistProposalItem() {} ClangAssistProposalItem() {}
virtual bool prematurelyApplies(const QChar &c) const; virtual bool prematurelyApplies(const QChar &c) const;
virtual void applyContextualContent(TextEditor::BaseTextEditorWidget *editorWidget, virtual void applyContextualContent(TextEditor::TextEditorWidget *editorWidget,
int basePosition) const; int basePosition) const;
void keepCompletionOperator(unsigned compOp) { m_completionOperator = compOp; } void keepCompletionOperator(unsigned compOp) { m_completionOperator = compOp; }
@@ -410,7 +410,7 @@ bool ClangAssistProposalItem::prematurelyApplies(const QChar &typedChar) const
return ok; return ok;
} }
void ClangAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, void ClangAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget,
int basePosition) const int basePosition) const
{ {
const CodeCompletionResult ccr = originalItem(); const CodeCompletionResult ccr = originalItem();
@@ -140,7 +140,7 @@ QString CMakeEditor::contextHelpId() const
// CMakeEditorWidget // CMakeEditorWidget
// //
class CMakeEditorWidget : public BaseTextEditorWidget class CMakeEditorWidget : public TextEditorWidget
{ {
public: public:
CMakeEditorWidget(); CMakeEditorWidget();
@@ -51,7 +51,7 @@ public:
friend class CMakeEditorWidget; friend class CMakeEditorWidget;
}; };
class CMakeEditorFactory : public TextEditor::BaseTextEditorFactory class CMakeEditorFactory : public TextEditor::TextEditorFactory
{ {
Q_OBJECT Q_OBJECT
@@ -236,7 +236,7 @@ namespace CppEditor {
namespace Internal { namespace Internal {
CppDocumentationCommentHelper::CppDocumentationCommentHelper( CppDocumentationCommentHelper::CppDocumentationCommentHelper(
TextEditor::BaseTextEditorWidget *editorWidget) TextEditor::TextEditorWidget *editorWidget)
: m_editorWidget(editorWidget) : m_editorWidget(editorWidget)
, m_settings(CppToolsSettings::instance()->commentsSettings()) , m_settings(CppToolsSettings::instance()->commentsSettings())
{ {
@@ -36,7 +36,7 @@
QT_FORWARD_DECLARE_CLASS(QKeyEvent) QT_FORWARD_DECLARE_CLASS(QKeyEvent)
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace CppEditor { namespace CppEditor {
namespace Internal { namespace Internal {
@@ -47,7 +47,7 @@ class CppDocumentationCommentHelper : public QObject
Q_DISABLE_COPY(CppDocumentationCommentHelper) Q_DISABLE_COPY(CppDocumentationCommentHelper)
public: public:
explicit CppDocumentationCommentHelper(TextEditor::BaseTextEditorWidget *editorWidget); explicit CppDocumentationCommentHelper(TextEditor::TextEditorWidget *editorWidget);
bool handleKeyPressEvent(QKeyEvent *e) const; bool handleKeyPressEvent(QKeyEvent *e) const;
private slots: private slots:
@@ -56,7 +56,7 @@ private slots:
private: private:
CppDocumentationCommentHelper(); CppDocumentationCommentHelper();
TextEditor::BaseTextEditorWidget *m_editorWidget; TextEditor::TextEditorWidget *m_editorWidget;
CppTools::CommentsSettings m_settings; CppTools::CommentsSettings m_settings;
}; };
+12 -12
View File
@@ -219,11 +219,11 @@ void CppEditorWidget::finalizeInitialization()
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updatePreprocessorButtonTooltip())); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updatePreprocessorButtonTooltip()));
updatePreprocessorButtonTooltip(); updatePreprocessorButtonTooltip();
connect(d->m_preprocessorButton, SIGNAL(clicked()), this, SLOT(showPreProcessorWidget())); connect(d->m_preprocessorButton, SIGNAL(clicked()), this, SLOT(showPreProcessorWidget()));
insertExtraToolBarWidget(BaseTextEditorWidget::Left, d->m_preprocessorButton); insertExtraToolBarWidget(TextEditorWidget::Left, d->m_preprocessorButton);
insertExtraToolBarWidget(BaseTextEditorWidget::Left, d->m_cppEditorOutline->widget()); insertExtraToolBarWidget(TextEditorWidget::Left, d->m_cppEditorOutline->widget());
} }
void CppEditorWidget::finalizeInitializationAfterDuplication(BaseTextEditorWidget *other) void CppEditorWidget::finalizeInitializationAfterDuplication(TextEditorWidget *other)
{ {
QTC_ASSERT(other, return); QTC_ASSERT(other, return);
CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget *>(other); CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget *>(other);
@@ -256,7 +256,7 @@ void CppEditorWidget::paste()
if (d->m_localRenaming.handlePaste()) if (d->m_localRenaming.handlePaste())
return; return;
BaseTextEditorWidget::paste(); TextEditorWidget::paste();
} }
void CppEditorWidget::cut() void CppEditorWidget::cut()
@@ -264,7 +264,7 @@ void CppEditorWidget::cut()
if (d->m_localRenaming.handleCut()) if (d->m_localRenaming.handleCut())
return; return;
BaseTextEditorWidget::cut(); TextEditorWidget::cut();
} }
void CppEditorWidget::selectAll() void CppEditorWidget::selectAll()
@@ -272,7 +272,7 @@ void CppEditorWidget::selectAll()
if (d->m_localRenaming.handleSelectAll()) if (d->m_localRenaming.handleSelectAll())
return; return;
BaseTextEditorWidget::selectAll(); TextEditorWidget::selectAll();
} }
void CppEditorWidget::onCppDocumentUpdated() void CppEditorWidget::onCppDocumentUpdated()
@@ -285,7 +285,7 @@ void CppEditorWidget::onCodeWarningsUpdated(unsigned revision,
{ {
if (revision != documentRevision()) if (revision != documentRevision())
return; return;
setExtraSelections(BaseTextEditorWidget::CodeWarningsSelection, selections); setExtraSelections(TextEditorWidget::CodeWarningsSelection, selections);
} }
void CppEditorWidget::onIfdefedOutBlocksUpdated(unsigned revision, void CppEditorWidget::onIfdefedOutBlocksUpdated(unsigned revision,
@@ -469,7 +469,7 @@ bool CppEditorWidget::event(QEvent *e)
break; break;
} }
return BaseTextEditorWidget::event(e); return TextEditorWidget::event(e);
} }
void CppEditorWidget::performQuickFix(int index) void CppEditorWidget::performQuickFix(int index)
@@ -479,7 +479,7 @@ void CppEditorWidget::performQuickFix(int index)
void CppEditorWidget::processKeyNormally(QKeyEvent *e) void CppEditorWidget::processKeyNormally(QKeyEvent *e)
{ {
BaseTextEditorWidget::keyPressEvent(e); TextEditorWidget::keyPressEvent(e);
} }
void CppEditorWidget::contextMenuEvent(QContextMenuEvent *e) void CppEditorWidget::contextMenuEvent(QContextMenuEvent *e)
@@ -541,13 +541,13 @@ void CppEditorWidget::keyPressEvent(QKeyEvent *e)
if (d->m_cppDocumentationCommentHelper.handleKeyPressEvent(e)) if (d->m_cppDocumentationCommentHelper.handleKeyPressEvent(e))
return; return;
BaseTextEditorWidget::keyPressEvent(e); TextEditorWidget::keyPressEvent(e);
} }
void CppEditorWidget::applyFontSettings() void CppEditorWidget::applyFontSettings()
{ {
// This also makes the document apply font settings // This also makes the document apply font settings
BaseTextEditorWidget::applyFontSettings(); TextEditorWidget::applyFontSettings();
} }
void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &) void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
@@ -610,7 +610,7 @@ AssistInterface *CppEditorWidget::createAssistInterface(AssistKind kind, AssistR
if (isSemanticInfoValid()) if (isSemanticInfoValid())
return new CppQuickFixAssistInterface(const_cast<CppEditorWidget *>(this), reason); return new CppQuickFixAssistInterface(const_cast<CppEditorWidget *>(this), reason);
} else { } else {
return BaseTextEditorWidget::createAssistInterface(kind, reason); return TextEditorWidget::createAssistInterface(kind, reason);
} }
return 0; return 0;
} }
+2 -2
View File
@@ -57,7 +57,7 @@ public:
CppEditor(); CppEditor();
}; };
class CppEditorWidget : public TextEditor::BaseTextEditorWidget class CppEditorWidget : public TextEditor::TextEditorWidget
{ {
Q_OBJECT Q_OBJECT
@@ -135,7 +135,7 @@ private slots:
private: private:
void finalizeInitialization() Q_DECL_OVERRIDE; void finalizeInitialization() Q_DECL_OVERRIDE;
void finalizeInitializationAfterDuplication(BaseTextEditorWidget *other) Q_DECL_OVERRIDE; void finalizeInitializationAfterDuplication(TextEditorWidget *other) Q_DECL_OVERRIDE;
unsigned documentRevision() const; unsigned documentRevision() const;
+1 -1
View File
@@ -252,7 +252,7 @@ void CppEditorOutline::gotoSymbolInEditor()
if (!symbol) if (!symbol)
return; return;
const TextEditor::BaseTextEditorWidget::Link &link = CppEditorWidget::linkToSymbol(symbol); const TextEditor::TextEditorWidget::Link &link = CppEditorWidget::linkToSymbol(symbol);
if (!link.hasValidTarget()) if (!link.hasValidTarget())
return; return;
+1 -1
View File
@@ -75,7 +75,7 @@ enum { QUICKFIX_INTERVAL = 20 };
//////////////////////////// CppEditorFactory ///////////////////////////// //////////////////////////// CppEditorFactory /////////////////////////////
class CppEditorFactory : public BaseTextEditorFactory class CppEditorFactory : public TextEditorFactory
{ {
public: public:
CppEditorFactory() CppEditorFactory()
@@ -61,7 +61,7 @@ static QStringList stripName(const QString &name)
return all; return all;
} }
CppElementEvaluator::CppElementEvaluator(TextEditor::BaseTextEditorWidget *editor) : CppElementEvaluator::CppElementEvaluator(TextEditor::TextEditorWidget *editor) :
m_editor(editor), m_editor(editor),
m_modelManager(CppTools::CppModelManager::instance()), m_modelManager(CppTools::CppModelManager::instance()),
m_tc(editor->textCursor()), m_tc(editor->textCursor()),
@@ -122,7 +122,7 @@ void CppElementEvaluator::execute()
void CppElementEvaluator::checkDiagnosticMessage(int pos) void CppElementEvaluator::checkDiagnosticMessage(int pos)
{ {
foreach (const QTextEdit::ExtraSelection &sel, 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()) { if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) {
m_diagnosis = sel.format.toolTip(); m_diagnosis = sel.format.toolTip();
break; break;
@@ -264,7 +264,7 @@ CppInclude::CppInclude(const Document::Include &includeFile) :
helpCategory = TextEditor::HelpItem::Brief; helpCategory = TextEditor::HelpItem::Brief;
helpIdCandidates = QStringList(fileName); helpIdCandidates = QStringList(fileName);
helpMark = fileName; helpMark = fileName;
link = TextEditor::BaseTextEditorWidget::Link(path); link = TextEditor::TextEditorWidget::Link(path);
tooltip = path; tooltip = path;
} }
@@ -275,7 +275,7 @@ CppMacro::CppMacro(const Macro &macro)
const QString macroName = QString::fromUtf8(macro.name(), macro.name().size()); const QString macroName = QString::fromUtf8(macro.name(), macro.name().size());
helpIdCandidates = QStringList(macroName); helpIdCandidates = QStringList(macroName);
helpMark = macroName; helpMark = macroName;
link = TextEditor::BaseTextEditorWidget::Link(macro.fileName(), macro.line()); link = TextEditor::TextEditorWidget::Link(macro.fileName(), macro.line());
tooltip = macro.toStringWithLineBreaks(); tooltip = macro.toStringWithLineBreaks();
} }
+3 -3
View File
@@ -56,7 +56,7 @@ class CppElement;
class CppElementEvaluator class CppElementEvaluator
{ {
public: public:
explicit CppElementEvaluator(TextEditor::BaseTextEditorWidget *editor); explicit CppElementEvaluator(TextEditor::TextEditorWidget *editor);
void setTextCursor(const QTextCursor &tc); void setTextCursor(const QTextCursor &tc);
void setLookupBaseClasses(const bool lookup); void setLookupBaseClasses(const bool lookup);
@@ -78,7 +78,7 @@ private:
const CPlusPlus::LookupContext &lookupContext, const CPlusPlus::LookupContext &lookupContext,
const CPlusPlus::Scope *scope); const CPlusPlus::Scope *scope);
TextEditor::BaseTextEditorWidget *m_editor; TextEditor::TextEditorWidget *m_editor;
CppTools::CppModelManager *m_modelManager; CppTools::CppModelManager *m_modelManager;
QTextCursor m_tc; QTextCursor m_tc;
bool m_lookupBaseClasses; bool m_lookupBaseClasses;
@@ -99,7 +99,7 @@ public:
TextEditor::HelpItem::Category helpCategory; TextEditor::HelpItem::Category helpCategory;
QStringList helpIdCandidates; QStringList helpIdCandidates;
QString helpMark; QString helpMark;
TextEditor::BaseTextEditorWidget::Link link; TextEditor::TextEditorWidget::Link link;
QString tooltip; QString tooltip;
}; };
@@ -54,7 +54,7 @@ using namespace CppEditor;
using namespace CppEditor::Internal; using namespace CppEditor::Internal;
using namespace TextEditor; using namespace TextEditor;
typedef BaseTextEditorWidget::Link Link; typedef TextEditorWidget::Link Link;
namespace { namespace {
@@ -424,7 +424,7 @@ static int skipMatchingParentheses(const QList<Token> &tokens, int idx, int init
return j; 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, bool resolveTarget, const Snapshot &theSnapshot, const Document::Ptr &documentFromSemanticInfo,
SymbolFinder *symbolFinder, bool inNextSplit) SymbolFinder *symbolFinder, bool inNextSplit)
{ {
@@ -49,7 +49,7 @@ class VirtualFunctionAssistProvider;
class FollowSymbolUnderCursor class FollowSymbolUnderCursor
{ {
public: public:
typedef TextEditor::BaseTextEditorWidget::Link Link; typedef TextEditor::TextEditorWidget::Link Link;
FollowSymbolUnderCursor(CppEditorWidget *widget); FollowSymbolUnderCursor(CppEditorWidget *widget);
~FollowSymbolUnderCursor(); ~FollowSymbolUnderCursor();
+1 -1
View File
@@ -57,7 +57,7 @@ bool CppHoverHandler::acceptEditor(IEditor *editor)
return editor->document()->id() == CppEditor::Constants::CPPEDITOR_ID; 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()) { if (!editorWidget->extraSelectionTooltip(pos).isEmpty()) {
setToolTip(editorWidget->extraSelectionTooltip(pos)); setToolTip(editorWidget->extraSelectionTooltip(pos));
+1 -1
View File
@@ -43,7 +43,7 @@ public:
private: private:
virtual bool acceptEditor(Core::IEditor *editor); 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(); virtual void decorateToolTip();
}; };
@@ -50,8 +50,7 @@
#include <QStandardItem> #include <QStandardItem>
#include <QVBoxLayout> #include <QVBoxLayout>
using namespace CppEditor; using namespace TextEditor;
using namespace CppEditor::Internal;
using namespace Utils; using namespace Utils;
namespace CppEditor { namespace CppEditor {
@@ -163,8 +162,7 @@ void CppIncludeHierarchyWidget::perform()
void CppIncludeHierarchyWidget::onItemActivated(const QModelIndex &index) void CppIncludeHierarchyWidget::onItemActivated(const QModelIndex &index)
{ {
const TextEditor::BaseTextEditorWidget::Link link const TextEditorWidget::Link link = index.data(LinkRole).value<TextEditorWidget::Link>();
= index.data(LinkRole).value<TextEditor::BaseTextEditorWidget::Link>();
if (link.hasValidTarget()) if (link.hasValidTarget())
Core::EditorManager::openEditorAt(link.targetFileName, Core::EditorManager::openEditorAt(link.targetFileName,
link.targetLine, link.targetLine,
@@ -149,7 +149,7 @@ QVariant CppIncludeHierarchyModel::data(const QModelIndex &index, int role) cons
return Core::FileIconProvider::icon(QFileInfo(item->filePath())); return Core::FileIconProvider::icon(QFileInfo(item->filePath()));
case LinkRole: { case LinkRole: {
QVariant itemLink; QVariant itemLink;
TextEditor::BaseTextEditorWidget::Link link(item->filePath(), item->line()); TextEditor::TextEditorWidget::Link link(item->filePath(), item->line());
itemLink.setValue(link); itemLink.setValue(link);
return itemLink; return itemLink;
} }
+4 -4
View File
@@ -61,7 +61,7 @@ void modifyCursorSelection(QTextCursor &cursor, int position, int anchor)
namespace CppEditor { namespace CppEditor {
namespace Internal { namespace Internal {
CppLocalRenaming::CppLocalRenaming(TextEditor::BaseTextEditorWidget *editorWidget) CppLocalRenaming::CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget)
: m_editorWidget(editorWidget) : m_editorWidget(editorWidget)
, m_modifyingSelections(false) , m_modifyingSelections(false)
, m_renameSelectionChanged(false) , m_renameSelectionChanged(false)
@@ -97,7 +97,7 @@ bool CppLocalRenaming::handlePaste()
return false; return false;
startRenameChange(); startRenameChange();
m_editorWidget->BaseTextEditorWidget::paste(); m_editorWidget->TextEditorWidget::paste();
finishRenameChange(); finishRenameChange();
return true; return true;
} }
@@ -108,7 +108,7 @@ bool CppLocalRenaming::handleCut()
return false; return false;
startRenameChange(); startRenameChange();
m_editorWidget->BaseTextEditorWidget::paste(); m_editorWidget->TextEditorWidget::paste();
finishRenameChange(); finishRenameChange();
return true; return true;
} }
@@ -289,7 +289,7 @@ void CppLocalRenaming::startRenameChange()
void CppLocalRenaming::updateEditorWidgetWithSelections() void CppLocalRenaming::updateEditorWidgetWithSelections()
{ {
m_editorWidget->setExtraSelections(TextEditor::BaseTextEditorWidget::CodeSemanticsSelection, m_editorWidget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection,
m_selections); m_selections);
} }
+3 -3
View File
@@ -34,7 +34,7 @@
#include <QTextEdit> #include <QTextEdit>
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace CppEditor { namespace CppEditor {
namespace Internal { namespace Internal {
@@ -45,7 +45,7 @@ class CppLocalRenaming : public QObject
Q_DISABLE_COPY(CppLocalRenaming) Q_DISABLE_COPY(CppLocalRenaming)
public: public:
explicit CppLocalRenaming(TextEditor::BaseTextEditorWidget *editorWidget); explicit CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget);
bool start(); bool start();
bool isActive() const; bool isActive() const;
@@ -95,7 +95,7 @@ private:
QTextCharFormat textCharFormat(TextEditor::TextStyle category) const; QTextCharFormat textCharFormat(TextEditor::TextStyle category) const;
private: private:
TextEditor::BaseTextEditorWidget *m_editorWidget; TextEditor::TextEditorWidget *m_editorWidget;
QList<QTextEdit::ExtraSelection> m_selections; QList<QTextEdit::ExtraSelection> m_selections;
int m_renameSelectionIndex; int m_renameSelectionIndex;
+1 -2
View File
@@ -232,8 +232,7 @@ void CppTypeHierarchyWidget::clearTypeHierarchy()
void CppTypeHierarchyWidget::onItemClicked(const QModelIndex &index) void CppTypeHierarchyWidget::onItemClicked(const QModelIndex &index)
{ {
const TextEditor::BaseTextEditorWidget::Link link auto link = index.data(LinkRole).value<TextEditor::TextEditorWidget::Link>();
= index.data(LinkRole).value<TextEditor::BaseTextEditorWidget::Link>();
if (link.hasValidTarget()) if (link.hasValidTarget())
Core::EditorManager::openEditorAt(link.targetFileName, Core::EditorManager::openEditorAt(link.targetFileName,
link.targetLine, link.targetLine,
@@ -123,7 +123,7 @@ SelectionList UseSelectionsTestCase::toSelectionList(
QList<QTextEdit::ExtraSelection> UseSelectionsTestCase::getExtraSelections() const QList<QTextEdit::ExtraSelection> UseSelectionsTestCase::getExtraSelections() const
{ {
return m_editorWidget->extraSelections( return m_editorWidget->extraSelections(
TextEditor::BaseTextEditorWidget::CodeSemanticsSelection); TextEditor::TextEditorWidget::CodeSemanticsSelection);
} }
SelectionList UseSelectionsTestCase::waitForUseSelections(bool *hasTimedOut) const SelectionList UseSelectionsTestCase::waitForUseSelections(bool *hasTimedOut) const
@@ -232,7 +232,7 @@ CppEditor::Internal::UseSelectionsResult findUses(const Params p)
namespace CppEditor { namespace CppEditor {
namespace Internal { namespace Internal {
CppUseSelectionsUpdater::CppUseSelectionsUpdater(TextEditor::BaseTextEditorWidget *editorWidget) CppUseSelectionsUpdater::CppUseSelectionsUpdater(TextEditor::TextEditorWidget *editorWidget)
: m_editorWidget(editorWidget) : m_editorWidget(editorWidget)
, m_findUsesRevision(-1) , m_findUsesRevision(-1)
{ {
@@ -460,18 +460,18 @@ QTextDocument *CppUseSelectionsUpdater::textDocument() const
ExtraSelections CppUseSelectionsUpdater::currentUseSelections() const ExtraSelections CppUseSelectionsUpdater::currentUseSelections() const
{ {
return m_editorWidget->extraSelections( return m_editorWidget->extraSelections(
TextEditor::BaseTextEditorWidget::CodeSemanticsSelection); TextEditor::TextEditorWidget::CodeSemanticsSelection);
} }
void CppUseSelectionsUpdater::updateUseSelections(const ExtraSelections &selections) void CppUseSelectionsUpdater::updateUseSelections(const ExtraSelections &selections)
{ {
m_editorWidget->setExtraSelections(TextEditor::BaseTextEditorWidget::CodeSemanticsSelection, m_editorWidget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection,
selections); selections);
} }
void CppUseSelectionsUpdater::updateUnusedSelections(const ExtraSelections &selections) void CppUseSelectionsUpdater::updateUnusedSelections(const ExtraSelections &selections)
{ {
m_editorWidget->setExtraSelections(TextEditor::BaseTextEditorWidget::UnusedSymbolSelection, m_editorWidget->setExtraSelections(TextEditor::TextEditorWidget::UnusedSymbolSelection,
selections); selections);
} }
@@ -44,7 +44,7 @@ class QTextCharFormat;
class QTextCursor; class QTextCursor;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace CppEditor { namespace CppEditor {
namespace Internal { namespace Internal {
@@ -66,7 +66,7 @@ class CppUseSelectionsUpdater : public QObject
Q_DISABLE_COPY(CppUseSelectionsUpdater) Q_DISABLE_COPY(CppUseSelectionsUpdater)
public: public:
explicit CppUseSelectionsUpdater(TextEditor::BaseTextEditorWidget *editorWidget); explicit CppUseSelectionsUpdater(TextEditor::TextEditorWidget *editorWidget);
enum CallType { Synchronous, Asynchronous }; enum CallType { Synchronous, Asynchronous };
@@ -105,7 +105,7 @@ private:
QTextDocument *textDocument() const; QTextDocument *textDocument() const;
private: private:
TextEditor::BaseTextEditorWidget *m_editorWidget; TextEditor::TextEditorWidget *m_editorWidget;
QTimer m_timer; QTimer m_timer;
@@ -34,12 +34,12 @@
using namespace CppEditor::Internal; using namespace CppEditor::Internal;
VirtualFunctionProposalItem::VirtualFunctionProposalItem( VirtualFunctionProposalItem::VirtualFunctionProposalItem(
const TextEditor::BaseTextEditorWidget::Link &link, bool openInSplit) const TextEditor::TextEditorWidget::Link &link, bool openInSplit)
: m_link(link), m_openInSplit(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()) if (!m_link.hasValidTarget())
return; return;
@@ -39,13 +39,13 @@ namespace Internal {
class VirtualFunctionProposalItem: public TextEditor::AssistProposalItem class VirtualFunctionProposalItem: public TextEditor::AssistProposalItem
{ {
public: public:
VirtualFunctionProposalItem(const TextEditor::BaseTextEditorWidget::Link &link, VirtualFunctionProposalItem(const TextEditor::TextEditorWidget::Link &link,
bool openInSplit = true); bool openInSplit = true);
void apply(TextEditor::BaseTextEditorWidget * /* editorWidget */, int /* basePosition */) const; void apply(TextEditor::TextEditorWidget * /* editorWidget */, int /* basePosition */) const;
TextEditor::BaseTextEditorWidget::Link link() const { return m_link; } // Exposed for tests TextEditor::TextEditorWidget::Link link() const { return m_link; } // Exposed for tests
private: private:
TextEditor::BaseTextEditorWidget::Link m_link; TextEditor::TextEditorWidget::Link m_link;
bool m_openInSplit; bool m_openInSplit;
}; };
@@ -220,7 +220,7 @@ namespace CppTools {
namespace Internal { namespace Internal {
static void applyRefactorings(QTextDocument *textDocument, TextEditor::BaseTextEditorWidget *editor, static void applyRefactorings(QTextDocument *textDocument, TextEditor::TextEditorWidget *editor,
const CppCodeStyleSettings &settings) const CppCodeStyleSettings &settings)
{ {
// Preprocess source // Preprocess source
+2 -2
View File
@@ -79,7 +79,7 @@ public:
m_editor = EditorManager::openEditor(fileName); m_editor = EditorManager::openEditor(fileName);
QVERIFY(m_editor); QVERIFY(m_editor);
closeEditorAtEndOfTestCase(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); QVERIFY(m_editorWidget);
m_textDocument = m_editorWidget->document(); m_textDocument = m_editorWidget->document();
@@ -149,7 +149,7 @@ private:
QByteArray m_source; QByteArray m_source;
int m_position; int m_position;
Snapshot m_snapshot; Snapshot m_snapshot;
BaseTextEditorWidget *m_editorWidget; TextEditorWidget *m_editorWidget;
QTextDocument *m_textDocument; QTextDocument *m_textDocument;
IEditor *m_editor; IEditor *m_editor;
}; };
+5 -5
View File
@@ -90,7 +90,7 @@ public:
m_isOverloaded(false) {} m_isOverloaded(false) {}
bool prematurelyApplies(const QChar &c) const Q_DECL_OVERRIDE; 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; } bool isOverloaded() const { return m_isOverloaded; }
void markAsOverloaded() { m_isOverloaded = true; } void markAsOverloaded() { m_isOverloaded = true; }
@@ -161,7 +161,7 @@ bool CppAssistProposalItem::prematurelyApplies(const QChar &typedChar) const
return false; return false;
} }
static bool isDereferenced(BaseTextEditorWidget *editorWidget, int basePosition) static bool isDereferenced(TextEditorWidget *editorWidget, int basePosition)
{ {
QTextCursor cursor = editorWidget->textCursor(); QTextCursor cursor = editorWidget->textCursor();
cursor.setPosition(basePosition); cursor.setPosition(basePosition);
@@ -181,7 +181,7 @@ static bool isDereferenced(BaseTextEditorWidget *editorWidget, int basePosition)
return false; return false;
} }
void CppAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const void CppAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget, int basePosition) const
{ {
Symbol *symbol = 0; Symbol *symbol = 0;
@@ -439,13 +439,13 @@ public:
{} {}
bool isCorrective() const Q_DECL_OVERRIDE { return m_replaceDotForArrow; } bool isCorrective() const Q_DECL_OVERRIDE { return m_replaceDotForArrow; }
void makeCorrection(BaseTextEditorWidget *editorWidget) Q_DECL_OVERRIDE; void makeCorrection(TextEditorWidget *editorWidget) Q_DECL_OVERRIDE;
private: private:
bool m_replaceDotForArrow; bool m_replaceDotForArrow;
}; };
void CppAssistProposal::makeCorrection(BaseTextEditorWidget *editorWidget) void CppAssistProposal::makeCorrection(TextEditorWidget *editorWidget)
{ {
const int oldPosition = editorWidget->position(); const int oldPosition = editorWidget->position();
editorWidget->setCursorPosition(basePosition() - 1); editorWidget->setCursorPosition(basePosition() - 1);
@@ -93,7 +93,7 @@ CppRefactoringChangesData *CppRefactoringChanges::data() const
return static_cast<CppRefactoringChangesData *>(m_data.data()); 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)); CppRefactoringFilePtr result(new CppRefactoringFile(editor));
result->setCppDocument(document); result->setCppDocument(document);
@@ -133,7 +133,7 @@ CppRefactoringFile::CppRefactoringFile(QTextDocument *document, const QString &f
: RefactoringFile(document, fileName) : RefactoringFile(document, fileName)
{ } { }
CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor) CppRefactoringFile::CppRefactoringFile(TextEditor::TextEditorWidget *editor)
: RefactoringFile(editor) : RefactoringFile(editor)
{ } { }
+2 -2
View File
@@ -75,7 +75,7 @@ public:
protected: protected:
CppRefactoringFile(const QString &fileName, const QSharedPointer<TextEditor::RefactoringChangesData> &data); CppRefactoringFile(const QString &fileName, const QSharedPointer<TextEditor::RefactoringChangesData> &data);
CppRefactoringFile(QTextDocument *document, const QString &fileName); CppRefactoringFile(QTextDocument *document, const QString &fileName);
CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor); CppRefactoringFile(TextEditor::TextEditorWidget *editor);
CppRefactoringChangesData *data() const; CppRefactoringChangesData *data() const;
virtual void fileChanged(); virtual void fileChanged();
@@ -90,7 +90,7 @@ class CPPTOOLS_EXPORT CppRefactoringChanges: public TextEditor::RefactoringChang
public: public:
CppRefactoringChanges(const CPlusPlus::Snapshot &snapshot); CppRefactoringChanges(const CPlusPlus::Snapshot &snapshot);
static CppRefactoringFilePtr file(TextEditor::BaseTextEditorWidget *editor, static CppRefactoringFilePtr file(TextEditor::TextEditorWidget *editor,
const CPlusPlus::Document::Ptr &document); const CPlusPlus::Document::Ptr &document);
CppRefactoringFilePtr file(const QString &fileName) const; CppRefactoringFilePtr file(const QString &fileName) const;
// safe to use from non-gui threads // safe to use from non-gui threads
+1 -1
View File
@@ -447,7 +447,7 @@ void CdbEngine::syncVerboseLog(bool verboseLog)
postCommand(m_verboseLog ? QByteArray("!sym noisy") : QByteArray("!sym quiet"), 0); 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) const DebuggerToolTipContext &contextIn)
{ {
if (debug) if (debug)
+1 -1
View File
@@ -76,7 +76,7 @@ public:
// Factory function that returns 0 if the debug engine library cannot be found. // 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); const DebuggerToolTipContext &ctx);
virtual void setupEngine(); virtual void setupEngine();
virtual void setupInferior(); virtual void setupInferior();
+1 -1
View File
@@ -1365,7 +1365,7 @@ DebuggerRunControl *DebuggerEngine::runControl() const
return d->runControl(); return d->runControl();
} }
bool DebuggerEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *, bool DebuggerEngine::setToolTipExpression(TextEditor::TextEditorWidget *,
const DebuggerToolTipContext &) const DebuggerToolTipContext &)
{ {
return false; return false;
+2 -2
View File
@@ -46,7 +46,7 @@ class QMessageBox;
class QAbstractItemModel; class QAbstractItemModel;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace Core { class IOptionsPage; } namespace Core { class IOptionsPage; }
namespace Debugger { namespace Debugger {
@@ -144,7 +144,7 @@ public:
const DebuggerStartParameters &startParameters() const; const DebuggerStartParameters &startParameters() const;
DebuggerStartParameters &startParameters(); DebuggerStartParameters &startParameters();
virtual bool setToolTipExpression(TextEditor::BaseTextEditorWidget *, virtual bool setToolTipExpression(TextEditor::TextEditorWidget *,
const Internal::DebuggerToolTipContext &); const Internal::DebuggerToolTipContext &);
virtual void updateWatchData(const Internal::WatchData &data, virtual void updateWatchData(const Internal::WatchData &data,
@@ -489,7 +489,7 @@ public:
QList<QPointer<DebuggerToolTipWidget> > m_tooltips; QList<QPointer<DebuggerToolTipWidget> > m_tooltips;
bool m_debugModeActive; bool m_debugModeActive;
QPoint m_lastToolTipPoint; QPoint m_lastToolTipPoint;
BaseTextEditorWidget *m_lastToolTipEditor; TextEditorWidget *m_lastToolTipEditor;
}; };
static DebuggerToolTipManagerData *d = 0; static DebuggerToolTipManagerData *d = 0;
@@ -532,7 +532,7 @@ public slots:
} }
void copy(); void copy();
void positionShow(const BaseTextEditorWidget *editorWidget); void positionShow(const TextEditorWidget *editorWidget);
void pin(); void pin();
public: public:
@@ -746,7 +746,7 @@ void DebuggerToolTipWidget::copy()
clipboard->setText(clipboardText, QClipboard::Clipboard); 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. // Figure out new position of tooltip using the text edit.
// If the line changed too much, close this tip. // If the line changed too much, close this tip.
@@ -1249,10 +1249,10 @@ void DebuggerToolTipManager::slotEditorOpened(IEditor *e)
{ {
// Move tooltip along when scrolled. // Move tooltip along when scrolled.
if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(e)) { if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(e)) {
BaseTextEditorWidget *widget = textEditor->editorWidget(); TextEditorWidget *widget = textEditor->editorWidget();
connect(widget->verticalScrollBar(), &QScrollBar::valueChanged, connect(widget->verticalScrollBar(), &QScrollBar::valueChanged,
this, &DebuggerToolTipManager::slotUpdateVisibleToolTips); this, &DebuggerToolTipManager::slotUpdateVisibleToolTips);
connect(widget, &BaseTextEditorWidget::tooltipOverrideRequested, connect(widget, &TextEditorWidget::tooltipOverrideRequested,
this, &DebuggerToolTipManager::slotTooltipOverrideRequested); this, &DebuggerToolTipManager::slotTooltipOverrideRequested);
} }
} }
@@ -1298,7 +1298,7 @@ void DebuggerToolTipManager::leavingDebugMode()
} }
void DebuggerToolTipManager::slotTooltipOverrideRequested 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(handled, return);
QTC_ASSERT(editorWidget, 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)) if (!boolSetting(UseToolTipsInMainEditor))
return false; return false;
@@ -41,7 +41,7 @@ class QDebug;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { class IEditor; } namespace Core { class IEditor; }
namespace TextEditor { class BaseTextEditor; class BaseTextEditorWidget; } namespace TextEditor { class BaseTextEditor; class TextEditorWidget; }
namespace Debugger { namespace Debugger {
class DebuggerEngine; class DebuggerEngine;
@@ -132,11 +132,11 @@ private slots:
static void slotUpdateVisibleToolTips(); static void slotUpdateVisibleToolTips();
void slotDebuggerStateChanged(Debugger::DebuggerState); void slotDebuggerStateChanged(Debugger::DebuggerState);
void slotEditorOpened(Core::IEditor *); void slotEditorOpened(Core::IEditor *);
void slotTooltipOverrideRequested(TextEditor::BaseTextEditorWidget *editorWidget, void slotTooltipOverrideRequested(TextEditor::TextEditorWidget *editorWidget,
const QPoint &point, int pos, bool *handled); const QPoint &point, int pos, bool *handled);
private: private:
bool tryHandleToolTipOverride(TextEditor::BaseTextEditorWidget *editorWidget, bool tryHandleToolTipOverride(TextEditor::TextEditorWidget *editorWidget,
const QPoint &point, int pos); const QPoint &point, int pos);
}; };
+2 -2
View File
@@ -239,7 +239,7 @@ void DisassemblerAgentPrivate::configureMimeType()
MimeType mtype = MimeDatabase::findByType(mimeType); MimeType mtype = MimeDatabase::findByType(mimeType);
if (mtype) { if (mtype) {
foreach (IEditor *editor, DocumentModel::editorsForDocument(document)) 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); widget->configureMimeType(mtype);
} else { } else {
qWarning("Assembler mimetype '%s' not found.", qPrintable(mimeType)); 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, Core::Constants::K_DEFAULT_TEXT_EDITOR_ID,
&titlePattern); &titlePattern);
QTC_ASSERT(editor, return); QTC_ASSERT(editor, return);
if (BaseTextEditorWidget *widget = qobject_cast<BaseTextEditorWidget *>(editor->widget())) { if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget())) {
widget->setReadOnly(true); widget->setReadOnly(true);
widget->setRequestMarkEnabled(true); widget->setRequestMarkEnabled(true);
} }
+1 -1
View File
@@ -3650,7 +3650,7 @@ void GdbEngine::resetLocation()
DebuggerEngine::resetLocation(); DebuggerEngine::resetLocation();
} }
bool GdbEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editor, bool GdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editor,
const DebuggerToolTipContext &context) const DebuggerToolTipContext &context)
{ {
if (state() != InferiorStopOk || !isCppEditor(editor)) { if (state() != InferiorStopOk || !isCppEditor(editor)) {
+1 -1
View File
@@ -407,7 +407,7 @@ protected:
// //
// Watch specific stuff // Watch specific stuff
// //
virtual bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editor, virtual bool setToolTipExpression(TextEditor::TextEditorWidget *editor,
const DebuggerToolTipContext &); const DebuggerToolTipContext &);
virtual void assignValueInDebugger(const WatchData *data, virtual void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value); const QString &expr, const QVariant &value);
+1 -1
View File
@@ -837,7 +837,7 @@ void LldbEngine::resetLocation()
DebuggerEngine::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)) { if (state() != InferiorStopOk || !isCppEditor(editorWidget)) {
//qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED " //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED "
+1 -1
View File
@@ -108,7 +108,7 @@ private:
void abortDebugger(); void abortDebugger();
void resetLocation(); void resetLocation();
bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget,
const DebuggerToolTipContext &); const DebuggerToolTipContext &);
void continueInferior(); void continueInferior();
+1 -1
View File
@@ -452,7 +452,7 @@ static WatchData m_toolTip;
static QPoint m_toolTipPos; static QPoint m_toolTipPos;
static QHash<QString, WatchData> m_toolTipCache; static QHash<QString, WatchData> m_toolTipCache;
bool PdbEngine::setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, bool PdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget,
const DebuggerToolTipContext &ctx) const DebuggerToolTipContext &ctx)
{ {
if (state() != InferiorStopOk) { if (state() != InferiorStopOk) {
+1 -1
View File
@@ -75,7 +75,7 @@ private:
void shutdownInferior(); void shutdownInferior();
void shutdownEngine(); void shutdownEngine();
bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget,
const DebuggerToolTipContext &); const DebuggerToolTipContext &);
void continueInferior(); void continueInferior();
+1 -1
View File
@@ -89,7 +89,7 @@ bool QmlCppEngine::canDisplayTooltip() const
return m_cppEngine->canDisplayTooltip() || m_qmlEngine->canDisplayTooltip(); 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); QTC_ASSERT(editorWidget, return false);
bool success = false; bool success = false;
+1 -1
View File
@@ -46,7 +46,7 @@ public:
~QmlCppEngine(); ~QmlCppEngine();
bool canDisplayTooltip() const; bool canDisplayTooltip() const;
bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget,
const DebuggerToolTipContext &); const DebuggerToolTipContext &);
void updateWatchData(const WatchData &data, void updateWatchData(const WatchData &data,
const WatchUpdateFlags &flags); const WatchUpdateFlags &flags);
+1 -1
View File
@@ -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) const DebuggerToolTipContext &ctx)
{ {
// This is processed by QML inspector, which has dependencies to // This is processed by QML inspector, which has dependencies to
+2 -2
View File
@@ -88,7 +88,7 @@ public:
signals: signals:
void tooltipRequested(const QPoint &mousePos, void tooltipRequested(const QPoint &mousePos,
TextEditor::BaseTextEditorWidget *editorWidget, int cursorPos); TextEditor::TextEditorWidget *editorWidget, int cursorPos);
void aboutToNotifyInferiorSetupOk(); void aboutToNotifyInferiorSetupOk();
private slots: private slots:
@@ -127,7 +127,7 @@ private:
void shutdownInferior(); void shutdownInferior();
void shutdownEngine(); void shutdownEngine();
bool setToolTipExpression(TextEditor::BaseTextEditorWidget *editorWidget, bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget,
const DebuggerToolTipContext &); const DebuggerToolTipContext &);
void continueInferior(); void continueInferior();
@@ -391,8 +391,8 @@ void QmlLiveTextPreview::associateEditor(Core::IEditor *editor)
QLatin1String("QmlJSEditor::Internal::QmlJSEditorWidget"), QLatin1String("QmlJSEditor::Internal::QmlJSEditorWidget"),
return); return);
BaseTextEditorWidget *editWidget TextEditorWidget *editWidget
= qobject_cast<BaseTextEditorWidget*>(editor->widget()); = qobject_cast<TextEditorWidget*>(editor->widget());
QTC_ASSERT(editWidget, return); QTC_ASSERT(editWidget, return);
if (!m_editors.contains(editWidget)) { if (!m_editors.contains(editWidget)) {
@@ -412,8 +412,8 @@ void QmlLiveTextPreview::unassociateEditor(Core::IEditor *oldEditor)
using namespace TextEditor; using namespace TextEditor;
if (oldEditor && oldEditor->document()->id() if (oldEditor && oldEditor->document()->id()
== QmlJSEditor::Constants::C_QMLJSEDITOR_ID) { == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
BaseTextEditorWidget *editWidget TextEditorWidget *editWidget
= qobject_cast<BaseTextEditorWidget*>(oldEditor->widget()); = qobject_cast<TextEditorWidget*>(oldEditor->widget());
QTC_ASSERT(editWidget, return); QTC_ASSERT(editWidget, return);
if (m_editors.contains(editWidget)) { 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. // will be shown in case the user changes and saves the file multiple times.
removeOutofSyncInfo(); removeOutofSyncInfo();
foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) { foreach (TextEditor::TextEditorWidget *editor, m_editors) {
if (editor) { if (editor) {
Core::InfoBar *infoBar = editor->textDocument()->infoBar(); Core::InfoBar *infoBar = editor->textDocument()->infoBar();
Core::InfoBarEntry info(Core::Id(INFO_OUT_OF_SYNC), errorMessage); Core::InfoBarEntry info(Core::Id(INFO_OUT_OF_SYNC), errorMessage);
@@ -729,7 +729,7 @@ void QmlLiveTextPreview::showSyncWarning(
void QmlLiveTextPreview::removeOutofSyncInfo() void QmlLiveTextPreview::removeOutofSyncInfo()
{ {
foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) { foreach (TextEditor::TextEditorWidget *editor, m_editors) {
if (editor) { if (editor) {
Core::InfoBar *infoBar = editor->textDocument()->infoBar(); Core::InfoBar *infoBar = editor->textDocument()->infoBar();
infoBar->removeInfo(Core::Id(INFO_OUT_OF_SYNC)); infoBar->removeInfo(Core::Id(INFO_OUT_OF_SYNC));
@@ -100,7 +100,7 @@ private:
QmlJS::Document::Ptr m_previousDoc; QmlJS::Document::Ptr m_previousDoc;
QmlJS::Document::Ptr m_initialDoc; //the document that was loaded by the server 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; bool m_applyChangesToQmlInspector;
QmlJS::Document::Ptr m_docWithUnappliedChanges; QmlJS::Document::Ptr m_docWithUnappliedChanges;
@@ -1785,7 +1785,7 @@ void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber,
errorFormat.setUnderlineColor(Qt::red); errorFormat.setUnderlineColor(Qt::red);
foreach (IEditor *editor, editors) { foreach (IEditor *editor, editors) {
TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget()); TextEditor::TextEditorWidget *ed = qobject_cast<TextEditor::TextEditorWidget *>(editor->widget());
if (!ed) if (!ed)
continue; continue;
@@ -1806,7 +1806,7 @@ void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber,
sel.format.setToolTip(errorMessage); sel.format.setToolTip(errorMessage);
selections.append(sel); 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) QString message = QString(_("%1: %2: %3")).arg(filePath).arg(lineNumber)
.arg(errorMessage); .arg(errorMessage);
@@ -1819,11 +1819,11 @@ void QmlV8DebuggerClient::clearExceptionSelection()
QList<QTextEdit::ExtraSelection> selections; QList<QTextEdit::ExtraSelection> selections;
foreach (IEditor *editor, DocumentModel::editorsForOpenedDocuments()) { 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) if (!ed)
continue; continue;
ed->setExtraSelections(TextEditor::BaseTextEditorWidget::DebuggerExceptionSelection, selections); ed->setExtraSelections(TextEditor::TextEditorWidget::DebuggerExceptionSelection, selections);
} }
} }
+1 -1
View File
@@ -118,7 +118,7 @@ void SourceAgent::setContent(const QString &filePath, const QString &content)
QTC_ASSERT(d->editor, return); QTC_ASSERT(d->editor, return);
d->editor->document()->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true); d->editor->document()->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true);
BaseTextEditorWidget *baseTextEdit = d->editor->editorWidget(); TextEditorWidget *baseTextEdit = d->editor->editorWidget();
if (baseTextEdit) if (baseTextEdit)
baseTextEdit->setRequestMarkEnabled(true); baseTextEdit->setRequestMarkEnabled(true);
} else { } else {
+2 -2
View File
@@ -260,7 +260,7 @@ bool getUninitializedVariables(const Snapshot &snapshot,
// Editor tooltip support // Editor tooltip support
bool isCppEditor(BaseTextEditorWidget *editorWidget) bool isCppEditor(TextEditorWidget *editorWidget)
{ {
const TextDocument *document = editorWidget->textDocument(); const TextDocument *document = editorWidget->textDocument();
return ProjectFile::classify(document->filePath()) != ProjectFile::Unclassified; 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 // 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 */) int *line, int *column, QString *function /* = 0 */)
{ {
*line = *column = 0; *line = *column = 0;
+3 -3
View File
@@ -32,15 +32,15 @@
#include <QString> #include <QString>
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace CPlusPlus { class Snapshot; } namespace CPlusPlus { class Snapshot; }
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
// Editor tooltip support // Editor tooltip support
bool isCppEditor(TextEditor::BaseTextEditorWidget *editorWidget); bool isCppEditor(TextEditor::TextEditorWidget *editorWidget);
QString cppExpressionAt(TextEditor::BaseTextEditorWidget *editorWidget, int pos, QString cppExpressionAt(TextEditor::TextEditorWidget *editorWidget, int pos,
int *line, int *column, QString *function = 0); int *line, int *column, QString *function = 0);
QString fixCppExpression(const QString &exp); QString fixCppExpression(const QString &exp);
QString cppFunctionAt(const QString &fileName, int line, int column = 0); QString cppFunctionAt(const QString &fileName, int line, int column = 0);
+2 -2
View File
@@ -112,7 +112,7 @@ namespace Internal {
* switch to design mode. * switch to design mode.
* Internally manages a FormWindowEditor and uses the plain text * Internally manages a FormWindowEditor and uses the plain text
* editable embedded in it. */ * editable embedded in it. */
class DesignerXmlEditorWidget : public TextEditor::BaseTextEditorWidget class DesignerXmlEditorWidget : public TextEditor::TextEditorWidget
{ {
public: public:
DesignerXmlEditorWidget() {} DesignerXmlEditorWidget() {}
@@ -124,7 +124,7 @@ public:
} }
}; };
class FormWindowEditorFactory : public TextEditor::BaseTextEditorFactory class FormWindowEditorFactory : public TextEditor::TextEditorFactory
{ {
public: public:
FormWindowEditorFactory() FormWindowEditorFactory()
+10 -10
View File
@@ -70,7 +70,7 @@ namespace DiffEditor {
namespace Internal { namespace Internal {
class DescriptionEditorWidget : public BaseTextEditorWidget class DescriptionEditorWidget : public TextEditorWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -96,7 +96,7 @@ private:
}; };
DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent) DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent)
: BaseTextEditorWidget(parent) : TextEditorWidget(parent)
{ {
setupFallBackEditor("DiffEditor.DescriptionEditor"); setupFallBackEditor("DiffEditor.DescriptionEditor");
@@ -107,7 +107,7 @@ DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent)
settings.m_displayFoldingMarkers = false; settings.m_displayFoldingMarkers = false;
settings.m_markTextChanges = false; settings.m_markTextChanges = false;
settings.m_highlightBlocks = false; settings.m_highlightBlocks = false;
BaseTextEditorWidget::setDisplaySettings(settings); TextEditorWidget::setDisplaySettings(settings);
setCodeFoldingSupported(true); setCodeFoldingSupported(true);
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
@@ -117,7 +117,7 @@ DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent)
QSize DescriptionEditorWidget::sizeHint() const QSize DescriptionEditorWidget::sizeHint() const
{ {
QSize size = BaseTextEditorWidget::sizeHint(); QSize size = TextEditorWidget::sizeHint();
size.setHeight(size.height() / 5); size.setHeight(size.height() / 5);
return size; return size;
} }
@@ -126,19 +126,19 @@ void DescriptionEditorWidget::setDisplaySettings(const DisplaySettings &ds)
{ {
DisplaySettings settings = displaySettings(); DisplaySettings settings = displaySettings();
settings.m_visualizeWhitespace = ds.m_visualizeWhitespace; settings.m_visualizeWhitespace = ds.m_visualizeWhitespace;
BaseTextEditorWidget::setDisplaySettings(settings); TextEditorWidget::setDisplaySettings(settings);
} }
void DescriptionEditorWidget::setMarginSettings(const MarginSettings &ms) void DescriptionEditorWidget::setMarginSettings(const MarginSettings &ms)
{ {
Q_UNUSED(ms); Q_UNUSED(ms);
BaseTextEditorWidget::setMarginSettings(MarginSettings()); TextEditorWidget::setMarginSettings(MarginSettings());
} }
void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e) void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e)
{ {
if (e->buttons()) { if (e->buttons()) {
BaseTextEditorWidget::mouseMoveEvent(e); TextEditorWidget::mouseMoveEvent(e);
return; return;
} }
@@ -153,7 +153,7 @@ void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e)
cursorShape = Qt::IBeamCursor; cursorShape = Qt::IBeamCursor;
} }
BaseTextEditorWidget::mouseMoveEvent(e); TextEditorWidget::mouseMoveEvent(e);
viewport()->setCursor(cursorShape); viewport()->setCursor(cursorShape);
} }
@@ -168,7 +168,7 @@ void DescriptionEditorWidget::mouseReleaseEvent(QMouseEvent *e)
} }
} }
BaseTextEditorWidget::mouseReleaseEvent(e); TextEditorWidget::mouseReleaseEvent(e);
} }
bool DescriptionEditorWidget::findContentsUnderCursor(const QTextCursor &cursor) bool DescriptionEditorWidget::findContentsUnderCursor(const QTextCursor &cursor)
@@ -183,7 +183,7 @@ void DescriptionEditorWidget::highlightCurrentContents()
sel.cursor = m_currentCursor; sel.cursor = m_currentCursor;
sel.cursor.select(QTextCursor::LineUnderCursor); sel.cursor.select(QTextCursor::LineUnderCursor);
sel.format.setFontUnderline(true); sel.format.setFontUnderline(true);
setExtraSelections(BaseTextEditorWidget::OtherSelection, setExtraSelections(TextEditorWidget::OtherSelection,
QList<QTextEdit::ExtraSelection>() << sel); QList<QTextEdit::ExtraSelection>() << sel);
} }
+2 -2
View File
@@ -43,7 +43,7 @@ class QToolButton;
class QStackedWidget; class QStackedWidget;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace TextEditor { class BaseTextEditorWidget; } namespace TextEditor { class TextEditorWidget; }
namespace DiffEditor { namespace DiffEditor {
@@ -94,7 +94,7 @@ private:
void writeCurrentDiffEditorSetting(QWidget *currentEditor); void writeCurrentDiffEditorSetting(QWidget *currentEditor);
QSharedPointer<DiffEditorDocument> m_document; QSharedPointer<DiffEditorDocument> m_document;
TextEditor::BaseTextEditorWidget *m_descriptionWidget; TextEditor::TextEditorWidget *m_descriptionWidget;
QStackedWidget *m_stackedWidget; QStackedWidget *m_stackedWidget;
SideBySideDiffEditorWidget *m_sideBySideEditor; SideBySideDiffEditorWidget *m_sideBySideEditor;
UnifiedDiffEditorWidget *m_unifiedEditor; UnifiedDiffEditorWidget *m_unifiedEditor;
@@ -36,7 +36,7 @@
namespace DiffEditor { namespace DiffEditor {
SelectableTextEditorWidget::SelectableTextEditorWidget(Core::Id id, QWidget *parent) SelectableTextEditorWidget::SelectableTextEditorWidget(Core::Id id, QWidget *parent)
: BaseTextEditorWidget(parent) : TextEditorWidget(parent)
{ {
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
setupFallBackEditor(id); setupFallBackEditor(id);
@@ -153,8 +153,7 @@ void SelectableTextEditorWidget::paintBlock(QPainter *painter,
} }
newSelections += selections; newSelections += selections;
BaseTextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect); TextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect);
} }
} // namespace DiffEditor } // namespace DiffEditor
@@ -48,7 +48,7 @@ public:
}; };
class DIFFEDITOR_EXPORT SelectableTextEditorWidget class DIFFEDITOR_EXPORT SelectableTextEditorWidget
: public TextEditor::BaseTextEditorWidget : public TextEditor::TextEditorWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -128,7 +128,7 @@ public:
void clearAll(const QString &message); void clearAll(const QString &message);
void clearAllData(); void clearAllData();
QTextBlock firstVisibleBlock() const { QTextBlock firstVisibleBlock() const {
return BaseTextEditorWidget::firstVisibleBlock(); return TextEditorWidget::firstVisibleBlock();
} }
// void setDocuments(const QList<QPair<DiffFileInfo, QString> > &documents); // void setDocuments(const QList<QPair<DiffFileInfo, QString> > &documents);
@@ -294,7 +294,7 @@ SideDiffEditorWidget::SideDiffEditorWidget(QWidget *parent)
settings.m_highlightBlocks = false; settings.m_highlightBlocks = false;
SelectableTextEditorWidget::setDisplaySettings(settings); 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(); int block = document()->findBlock(position).blockNumber();
auto it = m_fileInfo.constFind(block); auto it = m_fileInfo.constFind(block);
if (it != m_fileInfo.constEnd()) if (it != m_fileInfo.constEnd())
@@ -479,7 +479,7 @@ void SideDiffEditorWidget::clearAll(const QString &message)
setBlockSelection(false); setBlockSelection(false);
clear(); clear();
clearAllData(); clearAllData();
setExtraSelections(BaseTextEditorWidget::OtherSelection, setExtraSelections(TextEditorWidget::OtherSelection,
QList<QTextEdit::ExtraSelection>()); QList<QTextEdit::ExtraSelection>());
setPlainText(message); setPlainText(message);
// m_highlighter->setDocuments(QList<QPair<DiffFileInfo, QString> >()); // m_highlighter->setDocuments(QList<QPair<DiffFileInfo, QString> >());
+1 -1
View File
@@ -173,7 +173,7 @@ void EmacsKeysPlugin::currentEditorChanged(Core::IEditor *editor)
} }
m_currentState = m_stateMap[m_currentEditorWidget]; m_currentState = m_stateMap[m_currentEditorWidget];
m_currentBaseTextEditorWidget = m_currentBaseTextEditorWidget =
qobject_cast<TextEditor::BaseTextEditorWidget*>(editor->widget()); qobject_cast<TextEditor::TextEditorWidget*>(editor->widget());
} }
void EmacsKeysPlugin::gotoFileStart() { genericGoto(QTextCursor::Start); } void EmacsKeysPlugin::gotoFileStart() { genericGoto(QTextCursor::Start); }
+2 -2
View File
@@ -43,7 +43,7 @@ class Id;
class IEditor; class IEditor;
} }
namespace TextEditor { namespace TextEditor {
class BaseTextEditorWidget; class TextEditorWidget;
} }
namespace EmacsKeys { namespace EmacsKeys {
@@ -102,7 +102,7 @@ private:
QHash<QPlainTextEdit*, EmacsKeysState*> m_stateMap; QHash<QPlainTextEdit*, EmacsKeysState*> m_stateMap;
QPlainTextEdit *m_currentEditorWidget; QPlainTextEdit *m_currentEditorWidget;
EmacsKeysState *m_currentState; EmacsKeysState *m_currentState;
TextEditor::BaseTextEditorWidget *m_currentBaseTextEditorWidget; TextEditor::TextEditorWidget *m_currentBaseTextEditorWidget;
}; };
} // namespace Internal } // namespace Internal
+1 -1
View File
@@ -187,7 +187,7 @@ struct FakeVimPlugin::TestData
int oldPosition; int oldPosition;
QByteArray oldText; QByteArray oldText;
BaseTextEditorWidget *editor() const { return qobject_cast<BaseTextEditorWidget *>(edit); } TextEditorWidget *editor() const { return qobject_cast<TextEditorWidget *>(edit); }
QTextCursor cursor() const { return editor()->textCursor(); } QTextCursor cursor() const { return editor()->textCursor(); }
+16 -16
View File
@@ -240,7 +240,7 @@ class RelativeNumbersColumn : public QWidget
Q_OBJECT Q_OBJECT
public: public:
RelativeNumbersColumn(BaseTextEditorWidget *baseTextEditor) RelativeNumbersColumn(TextEditorWidget *baseTextEditor)
: QWidget(baseTextEditor) : QWidget(baseTextEditor)
, m_currentPos(0) , m_currentPos(0)
, m_lineSpacing(0) , m_lineSpacing(0)
@@ -352,7 +352,7 @@ private slots:
private: private:
int m_currentPos; int m_currentPos;
int m_lineSpacing; int m_lineSpacing;
BaseTextEditorWidget *m_editor; TextEditorWidget *m_editor;
QTimer m_timerUpdate; QTimer m_timerUpdate;
}; };
@@ -845,7 +845,7 @@ public:
if (!m_handler) if (!m_handler)
return; return;
BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(handler->widget()); TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(handler->widget());
if (!editor) if (!editor)
return; return;
@@ -898,7 +898,7 @@ public:
return text() == m_provider->needle(); 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); QTC_ASSERT(m_provider->handler(), return);
m_provider->handler()->handleReplay(text().mid(m_provider->needle().size())); m_provider->handler()->handleReplay(text().mid(m_provider->needle().size()));
@@ -1281,7 +1281,7 @@ void FakeVimPluginPrivate::userActionTriggered()
void FakeVimPluginPrivate::createRelativeNumberWidget(IEditor *editor) 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); RelativeNumbersColumn *relativeNumbers = new RelativeNumbersColumn(textEditor);
connect(theFakeVimSetting(ConfigRelativeNumber), SIGNAL(valueChanged(QVariant)), connect(theFakeVimSetting(ConfigRelativeNumber), SIGNAL(valueChanged(QVariant)),
relativeNumbers, SLOT(deleteLater())); relativeNumbers, SLOT(deleteLater()));
@@ -1574,7 +1574,7 @@ void FakeVimPluginPrivate::foldToggle(int depth)
void FakeVimPluginPrivate::foldAll(bool fold) void FakeVimPluginPrivate::foldAll(bool fold)
{ {
IEditor *ieditor = EditorManager::currentEditor(); IEditor *ieditor = EditorManager::currentEditor();
BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(ieditor->widget()); TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(ieditor->widget());
QTC_ASSERT(editor != 0, return); QTC_ASSERT(editor != 0, return);
QTextDocument *doc = editor->document(); QTextDocument *doc = editor->document();
@@ -1597,7 +1597,7 @@ void FakeVimPluginPrivate::fold(int depth, bool fold)
IEditor *ieditor = EditorManager::currentEditor(); IEditor *ieditor = EditorManager::currentEditor();
FakeVimHandler *handler = m_editorToHandler.value(ieditor, 0); FakeVimHandler *handler = m_editorToHandler.value(ieditor, 0);
QTC_ASSERT(handler != 0, return); QTC_ASSERT(handler != 0, return);
BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(ieditor->widget()); TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(ieditor->widget());
QTC_ASSERT(editor != 0, return); QTC_ASSERT(editor != 0, return);
QTextDocument *doc = editor->document(); QTextDocument *doc = editor->document();
@@ -1887,7 +1887,7 @@ void FakeVimPluginPrivate::triggerCompletions()
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler) if (!handler)
return; return;
if (BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *editor = qobject_cast<TextEditorWidget *>(handler->widget()))
editor->invokeAssist(Completion, m_wordProvider); editor->invokeAssist(Completion, m_wordProvider);
// CompletionSupport::instance()->complete(editor->editor(), TextCompletion, false); // CompletionSupport::instance()->complete(editor->editor(), TextCompletion, false);
} }
@@ -1903,7 +1903,7 @@ void FakeVimPluginPrivate::disableBlockSelection()
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler) if (!handler)
return; return;
if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()))
bt->setBlockSelection(false); bt->setBlockSelection(false);
} }
@@ -1912,7 +1912,7 @@ void FakeVimPluginPrivate::setBlockSelection(const QTextCursor &cursor)
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler) if (!handler)
return; return;
if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()))
bt->setBlockSelection(cursor); bt->setBlockSelection(cursor);
} }
@@ -1921,7 +1921,7 @@ void FakeVimPluginPrivate::blockSelection(QTextCursor *cursor)
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler) if (!handler)
return; return;
if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()))
if (cursor) if (cursor)
*cursor = bt->blockSelection(); *cursor = bt->blockSelection();
} }
@@ -1931,7 +1931,7 @@ void FakeVimPluginPrivate::hasBlockSelection(bool *on)
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler) if (!handler)
return; return;
if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()))
*on = bt->hasBlockSelection(); *on = bt->hasBlockSelection();
} }
@@ -1948,7 +1948,7 @@ void FakeVimPluginPrivate::checkForElectricCharacter(bool *result, QChar c)
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()); FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler) if (!handler)
return; return;
if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()))
*result = bt->textDocument()->indenter()->isElectricCharacter(c); *result = bt->textDocument()->indenter()->isElectricCharacter(c);
} }
@@ -2120,7 +2120,7 @@ void FakeVimPluginPrivate::indentRegion(int beginBlock, int endBlock,
if (!handler) if (!handler)
return; return;
BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget()); TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget());
if (!bt) if (!bt)
return; return;
@@ -2183,8 +2183,8 @@ void FakeVimPluginPrivate::showExtraInformation(const QString &text)
void FakeVimPluginPrivate::changeSelection(const QList<QTextEdit::ExtraSelection> &selection) void FakeVimPluginPrivate::changeSelection(const QList<QTextEdit::ExtraSelection> &selection)
{ {
if (FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender())) if (FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender()))
if (BaseTextEditorWidget *bt = qobject_cast<BaseTextEditorWidget *>(handler->widget())) if (TextEditorWidget *bt = qobject_cast<TextEditorWidget *>(handler->widget()))
bt->setExtraSelections(BaseTextEditorWidget::FakeVimSelection, selection); bt->setExtraSelections(TextEditorWidget::FakeVimSelection, selection);
} }
void FakeVimPluginPrivate::highlightMatches(const QString &needle) void FakeVimPluginPrivate::highlightMatches(const QString &needle)
@@ -35,7 +35,7 @@
namespace GenericProjectManager { namespace GenericProjectManager {
namespace Internal { namespace Internal {
class ProjectFilesFactory : public TextEditor::BaseTextEditorFactory class ProjectFilesFactory : public TextEditor::TextEditorFactory
{ {
public: public:
ProjectFilesFactory(); ProjectFilesFactory();
+3 -3
View File
@@ -109,7 +109,7 @@ protected:
// GlslEditorWidget // GlslEditorWidget
// //
class GlslEditorWidget : public BaseTextEditorWidget class GlslEditorWidget : public TextEditorWidget
{ {
public: public:
GlslEditorWidget(); GlslEditorWidget();
@@ -167,7 +167,7 @@ GlslEditorWidget::GlslEditorWidget()
policy.setHorizontalPolicy(QSizePolicy::Expanding); policy.setHorizontalPolicy(QSizePolicy::Expanding);
m_outlineCombo->setSizePolicy(policy); m_outlineCombo->setSizePolicy(policy);
insertExtraToolBarWidget(BaseTextEditorWidget::Left, m_outlineCombo); insertExtraToolBarWidget(TextEditorWidget::Left, m_outlineCombo);
// if (m_modelManager) { // if (m_modelManager) {
// m_semanticHighlighter->setModelManager(m_modelManager); // m_semanticHighlighter->setModelManager(m_modelManager);
@@ -319,7 +319,7 @@ AssistInterface *GlslEditorWidget::createAssistInterface(
reason, reason,
textDocument()->mimeType(), textDocument()->mimeType(),
m_glslDocument); m_glslDocument);
return BaseTextEditorWidget::createAssistInterface(kind, reason); return TextEditorWidget::createAssistInterface(kind, reason);
} }
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Internal {
int languageVariant(const QString &mimeType); int languageVariant(const QString &mimeType);
class GlslEditorFactory : public TextEditor::BaseTextEditorFactory class GlslEditorFactory : public TextEditor::TextEditorFactory
{ {
Q_OBJECT Q_OBJECT
+1 -1
View File
@@ -53,7 +53,7 @@ bool GlslHoverHandler::acceptEditor(IEditor *editor)
return editor->context().contains(Constants::C_GLSLEDITOR_ID); 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()) if (!editorWidget->extraSelectionTooltip(pos).isEmpty())
setToolTip(editorWidget->extraSelectionTooltip(pos)); setToolTip(editorWidget->extraSelectionTooltip(pos));
+1 -1
View File
@@ -50,7 +50,7 @@ public:
private: private:
virtual bool acceptEditor(Core::IEditor *editor); 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(); virtual void decorateToolTip();
}; };
@@ -254,7 +254,7 @@ void EditorConfiguration::fromMap(const QVariantMap &map)
void EditorConfiguration::configureEditor(BaseTextEditor *textEditor) const void EditorConfiguration::configureEditor(BaseTextEditor *textEditor) const
{ {
BaseTextEditorWidget *widget = textEditor->editorWidget(); TextEditorWidget *widget = textEditor->editorWidget();
if (widget) if (widget)
widget->setCodeStyle(codeStyle(widget->languageSettingsId())); widget->setCodeStyle(codeStyle(widget->languageSettingsId()));
if (!d->m_useGlobal) { if (!d->m_useGlobal) {
@@ -267,7 +267,7 @@ void EditorConfiguration::configureEditor(BaseTextEditor *textEditor) const
void EditorConfiguration::deconfigureEditor(BaseTextEditor *textEditor) const void EditorConfiguration::deconfigureEditor(BaseTextEditor *textEditor) const
{ {
BaseTextEditorWidget *widget = textEditor->editorWidget(); TextEditorWidget *widget = textEditor->editorWidget();
if (widget) if (widget)
widget->setCodeStyle(TextEditorSettings::codeStyle(widget->languageSettingsId())); widget->setCodeStyle(TextEditorSettings::codeStyle(widget->languageSettingsId()));
@@ -282,7 +282,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use)
d->m_defaultCodeStyle->setCurrentDelegate(d->m_useGlobal d->m_defaultCodeStyle->setCurrentDelegate(d->m_useGlobal
? TextEditorSettings::codeStyle() : 0); ? TextEditorSettings::codeStyle() : 0);
foreach (Core::IEditor *editor, Core::DocumentModel::editorsForOpenedDocuments()) { 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()); Project *project = SessionManager::projectForFile(editor->document()->filePath());
if (project && project->editorConfiguration() == this) if (project && project->editorConfiguration() == this)
switchSettings(widget); switchSettings(widget);
@@ -291,7 +291,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use)
} }
static void switchSettings_helper(const QObject *newSender, const QObject *oldSender, static void switchSettings_helper(const QObject *newSender, const QObject *oldSender,
BaseTextEditorWidget *widget) TextEditorWidget *widget)
{ {
QObject::disconnect(oldSender, SIGNAL(marginSettingsChanged(TextEditor::MarginSettings)), QObject::disconnect(oldSender, SIGNAL(marginSettingsChanged(TextEditor::MarginSettings)),
widget, SLOT(setMarginSettings(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))); widget, SLOT(setExtraEncodingSettings(TextEditor::ExtraEncodingSettings)));
} }
void EditorConfiguration::switchSettings(BaseTextEditorWidget *widget) const void EditorConfiguration::switchSettings(TextEditorWidget *widget) const
{ {
if (d->m_useGlobal) { if (d->m_useGlobal) {
widget->setMarginSettings(TextEditorSettings::marginSettings()); widget->setMarginSettings(TextEditorSettings::marginSettings());
@@ -42,7 +42,7 @@ class Id;
namespace TextEditor { namespace TextEditor {
class BaseTextEditor; class BaseTextEditor;
class BaseTextEditorWidget; class TextEditorWidget;
class TextDocument; class TextDocument;
class TabSettings; class TabSettings;
class ICodeStylePreferences; class ICodeStylePreferences;
@@ -112,7 +112,7 @@ private slots:
void slotAboutToRemoveProject(ProjectExplorer::Project *project); void slotAboutToRemoveProject(ProjectExplorer::Project *project);
void editorsClosed(const QList<Core::IEditor*> &closedEditors); void editorsClosed(const QList<Core::IEditor*> &closedEditors);
private: private:
void switchSettings(TextEditor::BaseTextEditorWidget *baseTextEditor) const; void switchSettings(TextEditor::TextEditorWidget *baseTextEditor) const;
EditorConfigurationPrivate *d; EditorConfigurationPrivate *d;
}; };
@@ -44,7 +44,7 @@ class EnvironmentItemsWidgetPrivate
public: public:
QList<Utils::EnvironmentItem> cleanUp( QList<Utils::EnvironmentItem> cleanUp(
const QList<Utils::EnvironmentItem> &items) const; const QList<Utils::EnvironmentItem> &items) const;
TextEditor::BaseTextEditorWidget *m_editor; TextEditor::TextEditorWidget *m_editor;
}; };
QList<Utils::EnvironmentItem> EnvironmentItemsWidgetPrivate::cleanUp( QList<Utils::EnvironmentItem> EnvironmentItemsWidgetPrivate::cleanUp(
+1 -1
View File
@@ -48,7 +48,7 @@ namespace Internal {
// PythonEditorWidget // PythonEditorWidget
// //
class PythonEditorWidget : public BaseTextEditorWidget class PythonEditorWidget : public TextEditorWidget
{ {
public: public:
PythonEditorWidget() PythonEditorWidget()
+1 -1
View File
@@ -35,7 +35,7 @@
namespace PythonEditor { namespace PythonEditor {
namespace Internal { namespace Internal {
class PythonEditorFactory : public TextEditor::BaseTextEditorFactory class PythonEditorFactory : public TextEditor::TextEditorFactory
{ {
Q_OBJECT Q_OBJECT
@@ -51,7 +51,7 @@ using namespace TextEditor;
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
class ProFileEditorWidget : public BaseTextEditorWidget class ProFileEditorWidget : public TextEditorWidget
{ {
public: public:
ProFileEditorWidget() ProFileEditorWidget()
@@ -35,7 +35,7 @@
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
class ProFileEditorFactory : public TextEditor::BaseTextEditorFactory class ProFileEditorFactory : public TextEditor::TextEditorFactory
{ {
Q_OBJECT Q_OBJECT
@@ -58,7 +58,7 @@ bool ProFileHoverHandler::acceptEditor(IEditor *editor)
return editor->context().contains(Constants::PROFILE_EDITOR_ID); 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_docFragment.clear();
m_manualKind = UnknownManual; m_manualKind = UnknownManual;
@@ -50,7 +50,7 @@ signals:
private: private:
virtual bool acceptEditor(Core::IEditor *editor); 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); void identifyQMakeKeyword(const QString &text, int pos);
enum ManualKind { enum ManualKind {
@@ -237,7 +237,7 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit)
connect(edit, SIGNAL(modificationChanged(bool)), connect(edit, SIGNAL(modificationChanged(bool)),
this, SIGNAL(dirtyStateChanged(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_documentModel->setTextModifier(m_documentTextModifier.data());
m_inFileComponentTextModifier.reset(); m_inFileComponentTextModifier.reset();
@@ -45,7 +45,7 @@ namespace QmlDesigner {
class QMLDESIGNERCORE_EXPORT BaseTextEditModifier: public PlainTextEditModifier class QMLDESIGNERCORE_EXPORT BaseTextEditModifier: public PlainTextEditModifier
{ {
public: public:
BaseTextEditModifier(TextEditor::BaseTextEditorWidget *textEdit); BaseTextEditModifier(TextEditor::TextEditorWidget *textEdit);
virtual void indent(int offset, int length); virtual void indent(int offset, int length);
@@ -37,7 +37,7 @@
using namespace QmlDesigner; using namespace QmlDesigner;
BaseTextEditModifier::BaseTextEditModifier(TextEditor::BaseTextEditorWidget *textEdit): BaseTextEditModifier::BaseTextEditModifier(TextEditor::TextEditorWidget *textEdit):
PlainTextEditModifier(textEdit) PlainTextEditModifier(textEdit)
{ {
} }
@@ -47,7 +47,7 @@ void BaseTextEditModifier::indent(int offset, int length)
if (length == 0 || offset < 0 || offset + length >= text().length()) if (length == 0 || offset < 0 || offset + length >= text().length())
return; return;
if (TextEditor::BaseTextEditorWidget *baseTextEditorWidget = qobject_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit())) { if (TextEditor::TextEditorWidget *baseTextEditorWidget = qobject_cast<TextEditor::TextEditorWidget*>(plainTextEdit())) {
TextEditor::TextDocument *baseTextEditorDocument = baseTextEditorWidget->textDocument(); TextEditor::TextDocument *baseTextEditorDocument = baseTextEditorWidget->textDocument();
QTextDocument *textDocument = baseTextEditorWidget->document(); QTextDocument *textDocument = baseTextEditorWidget->document();
@@ -81,7 +81,7 @@ void BaseTextEditModifier::indent(int offset, int length)
int BaseTextEditModifier::indentDepth() const 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; return bte->textDocument()->tabSettings().m_indentSize;
else else
return 0; return 0;
@@ -89,7 +89,7 @@ int BaseTextEditModifier::indentDepth() const
bool BaseTextEditModifier::renameId(const QString &oldId, const QString &newId) 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 if (QmlJSEditor::QmlJSEditorDocument *document
= qobject_cast<QmlJSEditor::QmlJSEditorDocument *>(bte->textDocument())) { = qobject_cast<QmlJSEditor::QmlJSEditorDocument *>(bte->textDocument())) {
Utils::ChangeSet changeSet; Utils::ChangeSet changeSet;
@@ -352,7 +352,7 @@ bool QmlJSAssistProposalItem::prematurelyApplies(const QChar &c) const
|| (text().endsWith(QLatin1Char('.')) && c == QLatin1Char('.')); || (text().endsWith(QLatin1Char('.')) && c == QLatin1Char('.'));
} }
void QmlJSAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget, void QmlJSAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget,
int basePosition) const int basePosition) const
{ {
const int currentPosition = editorWidget->position(); const int currentPosition = editorWidget->position();
@@ -56,7 +56,7 @@ class QmlJSAssistProposalItem : public TextEditor::AssistProposalItem
{ {
public: public:
bool prematurelyApplies(const QChar &c) const Q_DECL_OVERRIDE; 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; int basePosition) const Q_DECL_OVERRIDE;
}; };
+11 -11
View File
@@ -487,7 +487,7 @@ void QmlJSEditorWidget::setSelectedElements()
void QmlJSEditorWidget::applyFontSettings() void QmlJSEditorWidget::applyFontSettings()
{ {
BaseTextEditorWidget::applyFontSettings(); TextEditorWidget::applyFontSettings();
if (!m_qmlJsEditorDocument->isSemanticInfoOutdated()) if (!m_qmlJsEditorDocument->isSemanticInfoOutdated())
updateUses(); updateUses();
} }
@@ -553,10 +553,10 @@ void QmlJSEditorWidget::createToolBar()
connect(this, &QmlJSEditorWidget::cursorPositionChanged, connect(this, &QmlJSEditorWidget::cursorPositionChanged,
&m_updateOutlineIndexTimer, static_cast<void (QTimer::*)()>(&QTimer::start)); &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 /*resolveTarget*/,
bool /*inNextSplit*/) bool /*inNextSplit*/)
{ {
@@ -573,7 +573,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs
// if it's a file import, link to the file // if it's a file import, link to the file
foreach (const ImportInfo &import, semanticInfo.document->bind()->imports()) { foreach (const ImportInfo &import, semanticInfo.document->bind()->imports()) {
if (import.ast() == importAst && import.type() == ImportType::File) { if (import.ast() == importAst && import.type() == ImportType::File) {
BaseTextEditorWidget::Link link(import.path()); TextEditorWidget::Link link(import.path());
link.linkTextStart = importAst->firstSourceLocation().begin(); link.linkTextStart = importAst->firstSourceLocation().begin();
link.linkTextEnd = importAst->lastSourceLocation().end(); link.linkTextEnd = importAst->lastSourceLocation().end();
return link; return link;
@@ -585,7 +585,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs
// string literals that could refer to a file link to them // string literals that could refer to a file link to them
if (StringLiteral *literal = cast<StringLiteral *>(node)) { if (StringLiteral *literal = cast<StringLiteral *>(node)) {
const QString &text = literal->value.toString(); const QString &text = literal->value.toString();
BaseTextEditorWidget::Link link; TextEditorWidget::Link link;
link.linkTextStart = literal->literalToken.begin(); link.linkTextStart = literal->literalToken.begin();
link.linkTextEnd = literal->literalToken.end(); link.linkTextEnd = literal->literalToken.end();
if (semanticInfo.snapshot.document(text)) { if (semanticInfo.snapshot.document(text)) {
@@ -611,7 +611,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs
if (! (value && value->getSourceLocation(&fileName, &line, &column))) if (! (value && value->getSourceLocation(&fileName, &line, &column)))
return Link(); return Link();
BaseTextEditorWidget::Link link; TextEditorWidget::Link link;
link.targetFileName = fileName; link.targetFileName = fileName;
link.targetLine = line; link.targetLine = line;
link.targetColumn = column - 1; // adjust the column link.targetColumn = column - 1; // adjust the column
@@ -738,7 +738,7 @@ bool QmlJSEditorWidget::event(QEvent *e)
break; 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()) if (m_contextPane && m_contextPane->widget()->isVisible())
visible = true; visible = true;
BaseTextEditorWidget::wheelEvent(event); TextEditorWidget::wheelEvent(event);
if (visible) if (visible)
m_contextPane->apply(this, m_qmlJsEditorDocument->semanticInfo().document, 0, m_contextPane->apply(this, m_qmlJsEditorDocument->semanticInfo().document, 0,
@@ -758,13 +758,13 @@ void QmlJSEditorWidget::wheelEvent(QWheelEvent *event)
void QmlJSEditorWidget::resizeEvent(QResizeEvent *event) void QmlJSEditorWidget::resizeEvent(QResizeEvent *event)
{ {
BaseTextEditorWidget::resizeEvent(event); TextEditorWidget::resizeEvent(event);
hideContextPane(); hideContextPane();
} }
void QmlJSEditorWidget::scrollContentsBy(int dx, int dy) void QmlJSEditorWidget::scrollContentsBy(int dx, int dy)
{ {
BaseTextEditorWidget::scrollContentsBy(dx, dy); TextEditorWidget::scrollContentsBy(dx, dy);
hideContextPane(); hideContextPane();
} }
@@ -858,7 +858,7 @@ QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const
return QLatin1String("id: ") + objectId + QLatin1String("..."); return QLatin1String("id: ") + objectId + QLatin1String("...");
} }
return TextEditor::BaseTextEditorWidget::foldReplacementText(block); return TextEditor::TextEditorWidget::foldReplacementText(block);
} }
+3 -3
View File
@@ -59,7 +59,7 @@ class FindReferences;
namespace Internal { namespace Internal {
class QmlJSEditorWidget : public TextEditor::BaseTextEditorWidget class QmlJSEditorWidget : public TextEditor::TextEditorWidget
{ {
Q_OBJECT Q_OBJECT
@@ -106,7 +106,7 @@ protected:
void scrollContentsBy(int dx, int dy); void scrollContentsBy(int dx, int dy);
void applyFontSettings(); void applyFontSettings();
void createToolBar(); void createToolBar();
TextEditor::BaseTextEditorWidget::Link findLinkAt(const QTextCursor &cursor, TextEditor::TextEditorWidget::Link findLinkAt(const QTextCursor &cursor,
bool resolveTarget = true, bool resolveTarget = true,
bool inNextSplit = false); bool inNextSplit = false);
QString foldReplacementText(const QTextBlock &block) const; QString foldReplacementText(const QTextBlock &block) const;
@@ -148,7 +148,7 @@ public:
bool isDesignModePreferred() const; bool isDesignModePreferred() const;
}; };
class QmlJSEditorFactory : public TextEditor::BaseTextEditorFactory class QmlJSEditorFactory : public TextEditor::TextEditorFactory
{ {
Q_OBJECT Q_OBJECT
@@ -180,7 +180,7 @@ bool QmlJSHoverHandler::setQmlTypeHelp(const ScopeChain &scopeChain, const Docum
return true; return true;
} }
void QmlJSHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int pos) void QmlJSHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos)
{ {
reset(); reset();
@@ -256,7 +256,7 @@ void QmlJSHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int po
bool QmlJSHoverHandler::matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos) bool QmlJSHoverHandler::matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos)
{ {
foreach (const QTextEdit::ExtraSelection &sel, foreach (const QTextEdit::ExtraSelection &sel,
qmlEditor->extraSelections(BaseTextEditorWidget::CodeWarningsSelection)) { qmlEditor->extraSelections(TextEditorWidget::CodeWarningsSelection)) {
if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) { if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) {
setToolTip(sel.format.toolTip()); setToolTip(sel.format.toolTip());
return true; return true;
@@ -372,7 +372,7 @@ void QmlJSHoverHandler::reset()
m_colorTip = QColor(); m_colorTip = QColor();
} }
void QmlJSHoverHandler::operateTooltip(BaseTextEditorWidget *editorWidget, const QPoint &point) void QmlJSHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point)
{ {
if (toolTip().isEmpty()) if (toolTip().isEmpty())
Utils::ToolTip::hide(); Utils::ToolTip::hide();
+2 -2
View File
@@ -66,8 +66,8 @@ private:
void reset(); void reset();
bool acceptEditor(Core::IEditor *editor); bool acceptEditor(Core::IEditor *editor);
void identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos); void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos);
void operateTooltip(TextEditor::BaseTextEditorWidget *editorWidget, const QPoint &point); void operateTooltip(TextEditor::TextEditorWidget *editorWidget, const QPoint &point);
bool matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos); bool matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos);
bool matchColorItem(const QmlJS::ScopeChain &lookupContext, bool matchColorItem(const QmlJS::ScopeChain &lookupContext,
+2 -2
View File
@@ -115,7 +115,7 @@ QuickToolBar::~QuickToolBar()
m_widget = 0; 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) { if (!QuickToolBarSettings::get().enableContextPane && !force && !update) {
contextWidget()->hide(); 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()) if (document.isNull())
return false; return false;
+3 -3
View File
@@ -45,8 +45,8 @@ class QuickToolBar : public QmlJS::IContextPane
public: public:
QuickToolBar(QObject *parent = 0); QuickToolBar(QObject *parent = 0);
~QuickToolBar(); ~QuickToolBar();
void apply(TextEditor::BaseTextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false); 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::BaseTextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node); bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node);
void setProperty(const QString &propertyName, const QVariant &value); void setProperty(const QString &propertyName, const QVariant &value);
void removeProperty(const QString &propertyName); void removeProperty(const QString &propertyName);
void setEnabled(bool); void setEnabled(bool);
@@ -66,7 +66,7 @@ private:
QPointer<QmlEditorWidgets::ContextPaneWidget> m_widget; QPointer<QmlEditorWidgets::ContextPaneWidget> m_widget;
QmlJS::Document::Ptr m_doc; QmlJS::Document::Ptr m_doc;
QmlJS::AST::Node *m_node; QmlJS::AST::Node *m_node;
TextEditor::BaseTextEditorWidget *m_editorWidget; TextEditor::TextEditorWidget *m_editorWidget;
bool m_blockWriting; bool m_blockWriting;
QStringList m_propertyOrder; QStringList m_propertyOrder;
QStringList m_prototypes; QStringList m_prototypes;
@@ -105,7 +105,7 @@ QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file(const QString &fileName) c
} }
QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file( QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file(
TextEditor::BaseTextEditorWidget *editor, const Document::Ptr &document) TextEditor::TextEditorWidget *editor, const Document::Ptr &document)
{ {
return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(editor, document)); return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(editor, document));
} }
@@ -128,7 +128,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(const QString &fileName, const QShare
m_fileName.clear(); m_fileName.clear();
} }
QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::BaseTextEditorWidget *editor, QmlJS::Document::Ptr document) QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, QmlJS::Document::Ptr document)
: RefactoringFile(editor) : RefactoringFile(editor)
, m_qmljsDocument(document) , m_qmljsDocument(document)
{ {
@@ -62,7 +62,7 @@ public:
protected: protected:
QmlJSRefactoringFile(const QString &fileName, const QSharedPointer<TextEditor::RefactoringChangesData> &data); 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; QmlJSRefactoringChangesData *data() const;
virtual void fileChanged(); virtual void fileChanged();
@@ -79,7 +79,7 @@ public:
QmlJSRefactoringChanges(QmlJS::ModelManagerInterface *modelManager, QmlJSRefactoringChanges(QmlJS::ModelManagerInterface *modelManager,
const QmlJS::Snapshot &snapshot); const QmlJS::Snapshot &snapshot);
static QmlJSRefactoringFilePtr file(TextEditor::BaseTextEditorWidget *editor, static QmlJSRefactoringFilePtr file(TextEditor::TextEditorWidget *editor,
const QmlJS::Document::Ptr &document); const QmlJS::Document::Ptr &document);
QmlJSRefactoringFilePtr file(const QString &fileName) const; QmlJSRefactoringFilePtr file(const QString &fileName) const;
@@ -50,7 +50,7 @@ public:
{ {
} }
protected: protected:
TextEditor::BaseTextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const TextEditor::TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const
{ {
BarDescriptorEditorWidget *w = qobject_cast<BarDescriptorEditorWidget *>(editor->widget()); BarDescriptorEditorWidget *w = qobject_cast<BarDescriptorEditorWidget *>(editor->widget());
return w ? w->sourceWidget() : 0; return w ? w->sourceWidget() : 0;
@@ -168,11 +168,11 @@ void BarDescriptorEditorWidget::initAssetsPage()
void BarDescriptorEditorWidget::initSourcePage() 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->setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); // FIXME: This looks odd.
doc->setIndenter(new TextEditor::NormalIndenter); doc->setIndenter(new TextEditor::NormalIndenter);
m_xmlSourceWidget = new TextEditor::BaseTextEditorWidget(this); m_xmlSourceWidget = new TextEditor::TextEditorWidget(this);
m_xmlSourceWidget->setTextDocument(doc); m_xmlSourceWidget->setTextDocument(doc);
m_xmlSourceWidget->setupAsPlainEditor(); m_xmlSourceWidget->setupAsPlainEditor();
addWidget(m_xmlSourceWidget); addWidget(m_xmlSourceWidget);
@@ -186,7 +186,7 @@ void BarDescriptorEditorWidget::initPanelSize(ProjectExplorer::PanelsWidget *pan
panelsWidget->widget()->setMinimumWidth(0); panelsWidget->widget()->setMinimumWidth(0);
} }
TextEditor::BaseTextEditorWidget *BarDescriptorEditorWidget::sourceWidget() const TextEditor::TextEditorWidget *BarDescriptorEditorWidget::sourceWidget() const
{ {
return m_xmlSourceWidget; return m_xmlSourceWidget;
} }

Some files were not shown because too many files have changed in this diff Show More