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

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