forked from qt-creator/qt-creator
Editors: Some renamings to enhance consistency
The base pattern is FooEditor for BaseTextEditor derived classes and FooEditorWidget for BaseTextEditorWidget derived classes. So: CPPEditorWidget -> CppEditorWidget CPPEditorWidgetPrivate -> CppEditorWidgetPrivate ...::EditorWidget -> PythonEditorWidget GLSLTextEditorWidget -> GlslEditorWidget GLSLEditorEditable -> GlslEditor Change-Id: I76d34a3694c2fb35491982d86e83f7e4774c0be6 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -41,7 +41,7 @@ using namespace CPlusPlus;
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CanonicalSymbol::CanonicalSymbol(CPPEditorWidget *editor,
|
CanonicalSymbol::CanonicalSymbol(CppEditorWidget *editor,
|
||||||
const Document::Ptr &document,
|
const Document::Ptr &document,
|
||||||
const Snapshot &snapshot)
|
const Snapshot &snapshot)
|
||||||
: m_editorWidget(editor),
|
: m_editorWidget(editor),
|
||||||
|
@@ -39,12 +39,12 @@ QT_FORWARD_DECLARE_CLASS(QTextCursor)
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
|
|
||||||
class CanonicalSymbol
|
class CanonicalSymbol
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CanonicalSymbol(CPPEditorWidget *editorWidget,
|
CanonicalSymbol(CppEditorWidget *editorWidget,
|
||||||
const CPlusPlus::Document::Ptr &document,
|
const CPlusPlus::Document::Ptr &document,
|
||||||
const CPlusPlus::Snapshot &snapshot);
|
const CPlusPlus::Snapshot &snapshot);
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
CPlusPlus::TypeOfExpression &typeOfExpression);
|
CPlusPlus::TypeOfExpression &typeOfExpression);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPEditorWidget *m_editorWidget;
|
CppEditorWidget *m_editorWidget;
|
||||||
|
|
||||||
CPlusPlus::Document::Ptr m_document;
|
CPlusPlus::Document::Ptr m_document;
|
||||||
CPlusPlus::Snapshot m_snapshot;
|
CPlusPlus::Snapshot m_snapshot;
|
||||||
|
@@ -1369,8 +1369,8 @@ void CppCodeModelInspectorDialog::refresh()
|
|||||||
dumper.dumpSnapshot(editorSnapshot, editorSnapshotTitle);
|
dumper.dumpSnapshot(editorSnapshot, editorSnapshotTitle);
|
||||||
m_ui->snapshotSelector->addItem(editorSnapshotTitle);
|
m_ui->snapshotSelector->addItem(editorSnapshotTitle);
|
||||||
}
|
}
|
||||||
CppEditor::Internal::CPPEditorWidget *cppEditorWidget
|
CppEditor::Internal::CppEditorWidget *cppEditorWidget
|
||||||
= qobject_cast<CppEditor::Internal::CPPEditorWidget *>(editor->editorWidget());
|
= qobject_cast<CppEditor::Internal::CppEditorWidget *>(editor->editorWidget());
|
||||||
if (cppEditorWidget) {
|
if (cppEditorWidget) {
|
||||||
SemanticInfo semanticInfo = cppEditorWidget->semanticInfo();
|
SemanticInfo semanticInfo = cppEditorWidget->semanticInfo();
|
||||||
CPlusPlus::Snapshot snapshot;
|
CPlusPlus::Snapshot snapshot;
|
||||||
|
@@ -106,7 +106,7 @@ QTimer *newSingleShotTimer(QObject *parent, int msecInterval)
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CPPEditor::CPPEditor(CPPEditorWidget *editor)
|
CPPEditor::CPPEditor(CppEditorWidget *editor)
|
||||||
: BaseTextEditor(editor)
|
: BaseTextEditor(editor)
|
||||||
{
|
{
|
||||||
m_context.add(CppEditor::Constants::C_CPPEDITOR);
|
m_context.add(CppEditor::Constants::C_CPPEDITOR);
|
||||||
@@ -118,13 +118,13 @@ CPPEditor::CPPEditor(CPPEditorWidget *editor)
|
|||||||
|
|
||||||
Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
|
Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
|
||||||
|
|
||||||
class CPPEditorWidgetPrivate
|
class CppEditorWidgetPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CPPEditorWidgetPrivate(CPPEditorWidget *q);
|
CppEditorWidgetPrivate(CppEditorWidget *q);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPPEditorWidget *q;
|
CppEditorWidget *q;
|
||||||
|
|
||||||
QPointer<CppTools::CppModelManagerInterface> m_modelManager;
|
QPointer<CppTools::CppModelManagerInterface> m_modelManager;
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ public:
|
|||||||
QToolButton *m_preprocessorButton;
|
QToolButton *m_preprocessorButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
CPPEditorWidgetPrivate::CPPEditorWidgetPrivate(CPPEditorWidget *q)
|
CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
|
||||||
: q(q)
|
: q(q)
|
||||||
, m_modelManager(CppModelManagerInterface::instance())
|
, m_modelManager(CppModelManagerInterface::instance())
|
||||||
, m_cppEditorDocument(qobject_cast<CPPEditorDocument *>(q->baseTextDocument()))
|
, m_cppEditorDocument(qobject_cast<CPPEditorDocument *>(q->baseTextDocument()))
|
||||||
@@ -172,22 +172,22 @@ CPPEditorWidgetPrivate::CPPEditorWidgetPrivate(CPPEditorWidget *q)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::CPPEditorWidget(QWidget *parent)
|
CppEditorWidget::CppEditorWidget(QWidget *parent)
|
||||||
: TextEditor::BaseTextEditorWidget(new CPPEditorDocument(), parent)
|
: TextEditor::BaseTextEditorWidget(new CPPEditorDocument(), parent)
|
||||||
{
|
{
|
||||||
baseTextDocument()->setIndenter(new CppTools::CppQtStyleIndenter);
|
baseTextDocument()->setIndenter(new CppTools::CppQtStyleIndenter);
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::CPPEditorWidget(CPPEditorWidget *other)
|
CppEditorWidget::CppEditorWidget(CppEditorWidget *other)
|
||||||
: TextEditor::BaseTextEditorWidget(other)
|
: TextEditor::BaseTextEditorWidget(other)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::ctor()
|
void CppEditorWidget::ctor()
|
||||||
{
|
{
|
||||||
d.reset(new CPPEditorWidgetPrivate(this));
|
d.reset(new CppEditorWidgetPrivate(this));
|
||||||
|
|
||||||
qRegisterMetaType<SemanticInfo>("CppTools::SemanticInfo");
|
qRegisterMetaType<SemanticInfo>("CppTools::SemanticInfo");
|
||||||
|
|
||||||
@@ -221,30 +221,30 @@ void CPPEditorWidget::ctor()
|
|||||||
this, SLOT(onLocalRenamingProcessKeyPressNormally(QKeyEvent*)));
|
this, SLOT(onLocalRenamingProcessKeyPressNormally(QKeyEvent*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::~CPPEditorWidget()
|
CppEditorWidget::~CppEditorWidget()
|
||||||
{
|
{
|
||||||
if (d->m_modelManager)
|
if (d->m_modelManager)
|
||||||
d->m_modelManager->deleteCppEditorSupport(editor());
|
d->m_modelManager->deleteCppEditorSupport(editor());
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorDocument *CPPEditorWidget::cppEditorDocument() const
|
CPPEditorDocument *CppEditorWidget::cppEditorDocument() const
|
||||||
{
|
{
|
||||||
return d->m_cppEditorDocument;
|
return d->m_cppEditorDocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
CppEditorOutline *CPPEditorWidget::outline() const
|
CppEditorOutline *CppEditorWidget::outline() const
|
||||||
{
|
{
|
||||||
return d->m_cppEditorOutline;
|
return d->m_cppEditorOutline;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::BaseTextEditor *CPPEditorWidget::createEditor()
|
TextEditor::BaseTextEditor *CppEditorWidget::createEditor()
|
||||||
{
|
{
|
||||||
CPPEditor *editable = new CPPEditor(this);
|
CPPEditor *editable = new CPPEditor(this);
|
||||||
createToolBar(editable);
|
createToolBar(editable);
|
||||||
return editable;
|
return editable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::createToolBar(CPPEditor *editor)
|
void CppEditorWidget::createToolBar(CPPEditor *editor)
|
||||||
{
|
{
|
||||||
d->m_updateUsesTimer = newSingleShotTimer(this, UPDATE_USES_INTERVAL);
|
d->m_updateUsesTimer = newSingleShotTimer(this, UPDATE_USES_INTERVAL);
|
||||||
connect(d->m_updateUsesTimer, SIGNAL(timeout()), this, SLOT(updateUsesNow()));
|
connect(d->m_updateUsesTimer, SIGNAL(timeout()), this, SLOT(updateUsesNow()));
|
||||||
@@ -278,7 +278,7 @@ void CPPEditorWidget::createToolBar(CPPEditor *editor)
|
|||||||
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, d->m_cppEditorOutline->widget());
|
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, d->m_cppEditorOutline->widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::paste()
|
void CppEditorWidget::paste()
|
||||||
{
|
{
|
||||||
if (d->m_localRenaming.handlePaste())
|
if (d->m_localRenaming.handlePaste())
|
||||||
return;
|
return;
|
||||||
@@ -286,7 +286,7 @@ void CPPEditorWidget::paste()
|
|||||||
BaseTextEditorWidget::paste();
|
BaseTextEditorWidget::paste();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::cut()
|
void CppEditorWidget::cut()
|
||||||
{
|
{
|
||||||
if (d->m_localRenaming.handlePaste())
|
if (d->m_localRenaming.handlePaste())
|
||||||
return;
|
return;
|
||||||
@@ -294,7 +294,7 @@ void CPPEditorWidget::cut()
|
|||||||
BaseTextEditorWidget::cut();
|
BaseTextEditorWidget::cut();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::selectAll()
|
void CppEditorWidget::selectAll()
|
||||||
{
|
{
|
||||||
if (d->m_localRenaming.handleSelectAll())
|
if (d->m_localRenaming.handleSelectAll())
|
||||||
return;
|
return;
|
||||||
@@ -304,12 +304,12 @@ void CPPEditorWidget::selectAll()
|
|||||||
|
|
||||||
/// \brief Called by \c CppEditorSupport when the document corresponding to the
|
/// \brief Called by \c CppEditorSupport when the document corresponding to the
|
||||||
/// file in this editor is updated.
|
/// file in this editor is updated.
|
||||||
void CPPEditorWidget::onDocumentUpdated()
|
void CppEditorWidget::onDocumentUpdated()
|
||||||
{
|
{
|
||||||
d->m_cppEditorOutline->update();
|
d->m_cppEditorOutline->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Document::Ptr doc) const
|
const Macro *CppEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Document::Ptr doc) const
|
||||||
{
|
{
|
||||||
if (!doc)
|
if (!doc)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -329,7 +329,7 @@ const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Docu
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::findUsages()
|
void CppEditorWidget::findUsages()
|
||||||
{
|
{
|
||||||
if (!d->m_modelManager)
|
if (!d->m_modelManager)
|
||||||
return;
|
return;
|
||||||
@@ -348,7 +348,7 @@ void CPPEditorWidget::findUsages()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::renameUsages(const QString &replacement)
|
void CppEditorWidget::renameUsages(const QString &replacement)
|
||||||
{
|
{
|
||||||
if (!d->m_modelManager)
|
if (!d->m_modelManager)
|
||||||
return;
|
return;
|
||||||
@@ -367,7 +367,7 @@ void CPPEditorWidget::renameUsages(const QString &replacement)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::markSymbolsNow()
|
void CppEditorWidget::markSymbolsNow()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(d->m_referencesWatcher, return);
|
QTC_ASSERT(d->m_referencesWatcher, return);
|
||||||
if (!d->m_referencesWatcher->isCanceled()
|
if (!d->m_referencesWatcher->isCanceled()
|
||||||
@@ -417,7 +417,7 @@ static QList<int> lazyFindReferences(Scope *scope, QString code, Document::Ptr d
|
|||||||
return QList<int>();
|
return QList<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &info)
|
void CppEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &info)
|
||||||
{
|
{
|
||||||
d->m_localRenaming.stop();
|
d->m_localRenaming.stop();
|
||||||
|
|
||||||
@@ -482,7 +482,7 @@ void CPPEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &inf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::renameSymbolUnderCursor()
|
void CppEditorWidget::renameSymbolUnderCursor()
|
||||||
{
|
{
|
||||||
if (!d->m_modelManager)
|
if (!d->m_modelManager)
|
||||||
return;
|
return;
|
||||||
@@ -494,7 +494,7 @@ void CPPEditorWidget::renameSymbolUnderCursor()
|
|||||||
renameUsages(); // Rename non-local symbol or macro
|
renameUsages(); // Rename non-local symbol or macro
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int charsAdded)
|
void CppEditorWidget::onContentsChanged(int position, int charsRemoved, int charsAdded)
|
||||||
{
|
{
|
||||||
Q_UNUSED(position)
|
Q_UNUSED(position)
|
||||||
Q_UNUSED(charsAdded)
|
Q_UNUSED(charsAdded)
|
||||||
@@ -503,7 +503,7 @@ void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int char
|
|||||||
updateUses();
|
updateUses();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::updatePreprocessorButtonTooltip()
|
void CppEditorWidget::updatePreprocessorButtonTooltip()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(d->m_preprocessorButton, return);
|
QTC_ASSERT(d->m_preprocessorButton, return);
|
||||||
Core::Command *cmd = Core::ActionManager::command(Constants::OPEN_PREPROCESSOR_DIALOG);
|
Core::Command *cmd = Core::ActionManager::command(Constants::OPEN_PREPROCESSOR_DIALOG);
|
||||||
@@ -511,7 +511,7 @@ void CPPEditorWidget::updatePreprocessorButtonTooltip()
|
|||||||
d->m_preprocessorButton->setToolTip(cmd->action()->toolTip());
|
d->m_preprocessorButton->setToolTip(cmd->action()->toolTip());
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QTextEdit::ExtraSelection> CPPEditorWidget::createSelectionsFromUses(
|
QList<QTextEdit::ExtraSelection> CppEditorWidget::createSelectionsFromUses(
|
||||||
const QList<SemanticInfo::Use> &uses)
|
const QList<SemanticInfo::Use> &uses)
|
||||||
{
|
{
|
||||||
QList<QTextEdit::ExtraSelection> result;
|
QList<QTextEdit::ExtraSelection> result;
|
||||||
@@ -540,14 +540,14 @@ QList<QTextEdit::ExtraSelection> CPPEditorWidget::createSelectionsFromUses(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::updateUses()
|
void CppEditorWidget::updateUses()
|
||||||
{
|
{
|
||||||
// Block premature semantic info calculation when editor is created.
|
// Block premature semantic info calculation when editor is created.
|
||||||
if (d->m_modelManager && d->m_modelManager->cppEditorSupport(editor())->initialized())
|
if (d->m_modelManager && d->m_modelManager->cppEditorSupport(editor())->initialized())
|
||||||
d->m_updateUsesTimer->start();
|
d->m_updateUsesTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::updateUsesNow()
|
void CppEditorWidget::updateUsesNow()
|
||||||
{
|
{
|
||||||
if (d->m_localRenaming.isActive())
|
if (d->m_localRenaming.isActive())
|
||||||
return;
|
return;
|
||||||
@@ -555,7 +555,7 @@ void CPPEditorWidget::updateUsesNow()
|
|||||||
semanticRehighlight();
|
semanticRehighlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::highlightSymbolUsages(int from, int to)
|
void CppEditorWidget::highlightSymbolUsages(int from, int to)
|
||||||
{
|
{
|
||||||
if (editorRevision() != d->m_highlightRevision)
|
if (editorRevision() != d->m_highlightRevision)
|
||||||
return; // outdated
|
return; // outdated
|
||||||
@@ -570,7 +570,7 @@ void CPPEditorWidget::highlightSymbolUsages(int from, int to)
|
|||||||
highlighter, d->m_highlightWatcher->future(), from, to, d->m_semanticHighlightFormatMap);
|
highlighter, d->m_highlightWatcher->future(), from, to, d->m_semanticHighlightFormatMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::finishHighlightSymbolUsages()
|
void CppEditorWidget::finishHighlightSymbolUsages()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(d->m_highlightWatcher, return);
|
QTC_ASSERT(d->m_highlightWatcher, return);
|
||||||
if (!d->m_highlightWatcher->isCanceled()
|
if (!d->m_highlightWatcher->isCanceled()
|
||||||
@@ -585,7 +585,7 @@ void CPPEditorWidget::finishHighlightSymbolUsages()
|
|||||||
d->m_highlightWatcher.reset();
|
d->m_highlightWatcher.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
||||||
{
|
{
|
||||||
if (!d->m_modelManager)
|
if (!d->m_modelManager)
|
||||||
return;
|
return;
|
||||||
@@ -618,7 +618,7 @@ void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Link to function definition/declaration
|
// Link to function definition/declaration
|
||||||
CPPEditorWidget::Link symbolLink;
|
CppEditorWidget::Link symbolLink;
|
||||||
if (functionDeclarationSymbol) {
|
if (functionDeclarationSymbol) {
|
||||||
symbolLink = linkToSymbol(symbolFinder()
|
symbolLink = linkToSymbol(symbolFinder()
|
||||||
->findMatchingDefinition(functionDeclarationSymbol, d->m_modelManager->snapshot()));
|
->findMatchingDefinition(functionDeclarationSymbol, d->m_modelManager->snapshot()));
|
||||||
@@ -653,14 +653,14 @@ void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
|||||||
openCppEditorAt(symbolLink, inNextSplit != alwaysOpenLinksInNextSplit());
|
openCppEditorAt(symbolLink, inNextSplit != alwaysOpenLinksInNextSplit());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CPPEditorWidget::identifierUnderCursor(QTextCursor *macroCursor)
|
QString CppEditorWidget::identifierUnderCursor(QTextCursor *macroCursor)
|
||||||
{
|
{
|
||||||
macroCursor->movePosition(QTextCursor::StartOfWord);
|
macroCursor->movePosition(QTextCursor::StartOfWord);
|
||||||
macroCursor->movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
|
macroCursor->movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
|
||||||
return macroCursor->selectedText();
|
return macroCursor->selectedText();
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, bool resolveTarget,
|
CppEditorWidget::Link CppEditorWidget::findLinkAt(const QTextCursor &cursor, bool resolveTarget,
|
||||||
bool inNextSplit)
|
bool inNextSplit)
|
||||||
{
|
{
|
||||||
if (!d->m_modelManager)
|
if (!d->m_modelManager)
|
||||||
@@ -673,12 +673,12 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
|
|||||||
inNextSplit);
|
inNextSplit);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned CPPEditorWidget::editorRevision() const
|
unsigned CppEditorWidget::editorRevision() const
|
||||||
{
|
{
|
||||||
return document()->revision();
|
return document()->revision();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPPEditorWidget::isOutdated() const
|
bool CppEditorWidget::isOutdated() const
|
||||||
{
|
{
|
||||||
if (d->m_lastSemanticInfo.revision != editorRevision())
|
if (d->m_lastSemanticInfo.revision != editorRevision())
|
||||||
return true;
|
return true;
|
||||||
@@ -686,12 +686,12 @@ bool CPPEditorWidget::isOutdated() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SemanticInfo CPPEditorWidget::semanticInfo() const
|
SemanticInfo CppEditorWidget::semanticInfo() const
|
||||||
{
|
{
|
||||||
return d->m_lastSemanticInfo;
|
return d->m_lastSemanticInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPPEditorWidget::event(QEvent *e)
|
bool CppEditorWidget::event(QEvent *e)
|
||||||
{
|
{
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::ShortcutOverride:
|
case QEvent::ShortcutOverride:
|
||||||
@@ -708,13 +708,13 @@ bool CPPEditorWidget::event(QEvent *e)
|
|||||||
return BaseTextEditorWidget::event(e);
|
return BaseTextEditorWidget::event(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::performQuickFix(int index)
|
void CppEditorWidget::performQuickFix(int index)
|
||||||
{
|
{
|
||||||
TextEditor::QuickFixOperation::Ptr op = d->m_quickFixes.at(index);
|
TextEditor::QuickFixOperation::Ptr op = d->m_quickFixes.at(index);
|
||||||
op->perform();
|
op->perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
void CppEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||||
{
|
{
|
||||||
// ### enable
|
// ### enable
|
||||||
// updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource()));
|
// updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource()));
|
||||||
@@ -770,7 +770,7 @@ void CPPEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::keyPressEvent(QKeyEvent *e)
|
void CppEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||||
{
|
{
|
||||||
if (d->m_localRenaming.handleKeyPressEvent(e))
|
if (d->m_localRenaming.handleKeyPressEvent(e))
|
||||||
return;
|
return;
|
||||||
@@ -783,8 +783,8 @@ void CPPEditorWidget::keyPressEvent(QKeyEvent *e)
|
|||||||
|
|
||||||
Core::IEditor *CPPEditor::duplicate()
|
Core::IEditor *CPPEditor::duplicate()
|
||||||
{
|
{
|
||||||
CPPEditorWidget *newEditor = new CPPEditorWidget(
|
CppEditorWidget *newEditor = new CppEditorWidget(
|
||||||
qobject_cast<CPPEditorWidget *>(editorWidget()));
|
qobject_cast<CppEditorWidget *>(editorWidget()));
|
||||||
CppEditorPlugin::instance()->initializeEditor(newEditor);
|
CppEditorPlugin::instance()->initializeEditor(newEditor);
|
||||||
return newEditor->editor();
|
return newEditor->editor();
|
||||||
}
|
}
|
||||||
@@ -802,7 +802,7 @@ TextEditor::CompletionAssistProvider *CPPEditor::completionAssistProvider()
|
|||||||
return CppModelManagerInterface::instance()->cppEditorSupport(this)->completionAssistProvider();
|
return CppModelManagerInterface::instance()->cppEditorSupport(this)->completionAssistProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::applyFontSettings()
|
void CppEditorWidget::applyFontSettings()
|
||||||
{
|
{
|
||||||
const TextEditor::FontSettings &fs = baseTextDocument()->fontSettings();
|
const TextEditor::FontSettings &fs = baseTextDocument()->fontSettings();
|
||||||
|
|
||||||
@@ -832,13 +832,13 @@ void CPPEditorWidget::applyFontSettings()
|
|||||||
semanticRehighlight(true);
|
semanticRehighlight(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
|
void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
|
||||||
{
|
{
|
||||||
CppTools::QtStyleCodeFormatter formatter;
|
CppTools::QtStyleCodeFormatter formatter;
|
||||||
formatter.invalidateCache(document());
|
formatter.invalidateCache(document());
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
CppEditorWidget::Link CppEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
||||||
{
|
{
|
||||||
if (!symbol)
|
if (!symbol)
|
||||||
return Link();
|
return Link();
|
||||||
@@ -858,7 +858,7 @@ CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
|||||||
return Link(filename, line, column);
|
return Link(filename, line, column);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPPEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
|
bool CppEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
|
||||||
{
|
{
|
||||||
if (!link.hasValidTarget())
|
if (!link.hasValidTarget())
|
||||||
return false;
|
return false;
|
||||||
@@ -873,7 +873,7 @@ bool CPPEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::semanticRehighlight(bool force)
|
void CppEditorWidget::semanticRehighlight(bool force)
|
||||||
{
|
{
|
||||||
if (d->m_modelManager) {
|
if (d->m_modelManager) {
|
||||||
const CppEditorSupport::ForceReason forceReason = force
|
const CppEditorSupport::ForceReason forceReason = force
|
||||||
@@ -883,7 +883,7 @@ void CPPEditorWidget::semanticRehighlight(bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult> *highlighter,
|
void CppEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult> *highlighter,
|
||||||
unsigned revision)
|
unsigned revision)
|
||||||
{
|
{
|
||||||
d->m_highlightRevision = revision;
|
d->m_highlightRevision = revision;
|
||||||
@@ -897,7 +897,7 @@ void CPPEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult>
|
|||||||
d->m_highlightWatcher->setFuture(QFuture<TextEditor::HighlightingResult>(*highlighter));
|
d->m_highlightWatcher->setFuture(QFuture<TextEditor::HighlightingResult>(*highlighter));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
void CppEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||||
{
|
{
|
||||||
if (semanticInfo.revision != editorRevision()) {
|
if (semanticInfo.revision != editorRevision()) {
|
||||||
// got outdated semantic info
|
// got outdated semantic info
|
||||||
@@ -956,7 +956,7 @@ void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
|||||||
updateFunctionDeclDefLink();
|
updateFunctionDeclDefLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::IAssistInterface *CPPEditorWidget::createAssistInterface(
|
TextEditor::IAssistInterface *CppEditorWidget::createAssistInterface(
|
||||||
TextEditor::AssistKind kind,
|
TextEditor::AssistKind kind,
|
||||||
TextEditor::AssistReason reason) const
|
TextEditor::AssistReason reason) const
|
||||||
{
|
{
|
||||||
@@ -972,25 +972,25 @@ TextEditor::IAssistInterface *CPPEditorWidget::createAssistInterface(
|
|||||||
} else if (kind == TextEditor::QuickFix) {
|
} else if (kind == TextEditor::QuickFix) {
|
||||||
if (!semanticInfo().doc || isOutdated())
|
if (!semanticInfo().doc || isOutdated())
|
||||||
return 0;
|
return 0;
|
||||||
return new CppQuickFixAssistInterface(const_cast<CPPEditorWidget *>(this), reason);
|
return new CppQuickFixAssistInterface(const_cast<CppEditorWidget *>(this), reason);
|
||||||
} else {
|
} else {
|
||||||
return BaseTextEditorWidget::createAssistInterface(kind, reason);
|
return BaseTextEditorWidget::createAssistInterface(kind, reason);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<FunctionDeclDefLink> CPPEditorWidget::declDefLink() const
|
QSharedPointer<FunctionDeclDefLink> CppEditorWidget::declDefLink() const
|
||||||
{
|
{
|
||||||
return d->m_declDefLink;
|
return d->m_declDefLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::onRefactorMarkerClicked(const TextEditor::RefactorMarker &marker)
|
void CppEditorWidget::onRefactorMarkerClicked(const TextEditor::RefactorMarker &marker)
|
||||||
{
|
{
|
||||||
if (marker.data.canConvert<FunctionDeclDefLink::Marker>())
|
if (marker.data.canConvert<FunctionDeclDefLink::Marker>())
|
||||||
applyDeclDefLinkChanges(true);
|
applyDeclDefLinkChanges(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::updateFunctionDeclDefLink()
|
void CppEditorWidget::updateFunctionDeclDefLink()
|
||||||
{
|
{
|
||||||
const int pos = textCursor().selectionStart();
|
const int pos = textCursor().selectionStart();
|
||||||
|
|
||||||
@@ -1016,7 +1016,7 @@ void CPPEditorWidget::updateFunctionDeclDefLink()
|
|||||||
d->m_updateFunctionDeclDefLinkTimer->start();
|
d->m_updateFunctionDeclDefLinkTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::updateFunctionDeclDefLinkNow()
|
void CppEditorWidget::updateFunctionDeclDefLinkNow()
|
||||||
{
|
{
|
||||||
if (Core::EditorManager::currentEditor() != editor())
|
if (Core::EditorManager::currentEditor() != editor())
|
||||||
return;
|
return;
|
||||||
@@ -1038,7 +1038,7 @@ void CPPEditorWidget::updateFunctionDeclDefLinkNow()
|
|||||||
d->m_declDefLinkFinder->startFindLinkAt(textCursor(), d->m_lastSemanticInfo.doc, snapshot);
|
d->m_declDefLinkFinder->startFindLinkAt(textCursor(), d->m_lastSemanticInfo.doc, snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefLink> link)
|
void CppEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefLink> link)
|
||||||
{
|
{
|
||||||
abortDeclDefLink();
|
abortDeclDefLink();
|
||||||
d->m_declDefLink = link;
|
d->m_declDefLink = link;
|
||||||
@@ -1052,7 +1052,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::onFilePathChanged()
|
void CppEditorWidget::onFilePathChanged()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(d->m_modelManager, return);
|
QTC_ASSERT(d->m_modelManager, return);
|
||||||
QByteArray additionalDirectives;
|
QByteArray additionalDirectives;
|
||||||
@@ -1072,7 +1072,7 @@ void CPPEditorWidget::onFilePathChanged()
|
|||||||
d->m_preprocessorButton->update();
|
d->m_preprocessorButton->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
void CppEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
||||||
{
|
{
|
||||||
if (!d->m_declDefLink)
|
if (!d->m_declDefLink)
|
||||||
return;
|
return;
|
||||||
@@ -1081,12 +1081,12 @@ void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
|||||||
updateFunctionDeclDefLink();
|
updateFunctionDeclDefLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
FollowSymbolUnderCursor *CPPEditorWidget::followSymbolUnderCursorDelegate()
|
FollowSymbolUnderCursor *CppEditorWidget::followSymbolUnderCursorDelegate()
|
||||||
{
|
{
|
||||||
return d->m_followSymbolUnderCursor.data();
|
return d->m_followSymbolUnderCursor.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::abortDeclDefLink()
|
void CppEditorWidget::abortDeclDefLink()
|
||||||
{
|
{
|
||||||
if (!d->m_declDefLink)
|
if (!d->m_declDefLink)
|
||||||
return;
|
return;
|
||||||
@@ -1103,22 +1103,22 @@ void CPPEditorWidget::abortDeclDefLink()
|
|||||||
d->m_declDefLink.clear();
|
d->m_declDefLink.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::onLocalRenamingFinished()
|
void CppEditorWidget::onLocalRenamingFinished()
|
||||||
{
|
{
|
||||||
semanticRehighlight(true);
|
semanticRehighlight(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::onLocalRenamingProcessKeyPressNormally(QKeyEvent *e)
|
void CppEditorWidget::onLocalRenamingProcessKeyPressNormally(QKeyEvent *e)
|
||||||
{
|
{
|
||||||
BaseTextEditorWidget::keyPressEvent(e);
|
BaseTextEditorWidget::keyPressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextCharFormat CPPEditorWidget::textCharFormat(TextEditor::TextStyle category)
|
QTextCharFormat CppEditorWidget::textCharFormat(TextEditor::TextStyle category)
|
||||||
{
|
{
|
||||||
return baseTextDocument()->fontSettings().toTextCharFormat(category);
|
return baseTextDocument()->fontSettings().toTextCharFormat(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPPEditorWidget::showPreProcessorWidget()
|
void CppEditorWidget::showPreProcessorWidget()
|
||||||
{
|
{
|
||||||
const QString &fileName = editor()->document()->filePath();
|
const QString &fileName = editor()->document()->filePath();
|
||||||
|
|
||||||
|
@@ -50,15 +50,16 @@ namespace CppEditor {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CppEditorOutline;
|
class CppEditorOutline;
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class CPPEditorWidgetPrivate;
|
class CppEditorWidgetPrivate;
|
||||||
class FollowSymbolUnderCursor;
|
class FollowSymbolUnderCursor;
|
||||||
|
|
||||||
class CPPEditor : public TextEditor::BaseTextEditor
|
class CPPEditor : public TextEditor::BaseTextEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPPEditor(CPPEditorWidget *);
|
CPPEditor(CppEditorWidget *);
|
||||||
|
|
||||||
Core::IEditor *duplicate() QTC_OVERRIDE;
|
Core::IEditor *duplicate() QTC_OVERRIDE;
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ public:
|
|||||||
TextEditor::CompletionAssistProvider *completionAssistProvider() QTC_OVERRIDE;
|
TextEditor::CompletionAssistProvider *completionAssistProvider() QTC_OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPPEditorWidget : public TextEditor::BaseTextEditorWidget
|
class CppEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -78,9 +79,9 @@ public:
|
|||||||
static QString identifierUnderCursor(QTextCursor *macroCursor);
|
static QString identifierUnderCursor(QTextCursor *macroCursor);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPPEditorWidget(QWidget *parent = 0);
|
CppEditorWidget(QWidget *parent = 0);
|
||||||
CPPEditorWidget(CPPEditorWidget *other);
|
CppEditorWidget(CppEditorWidget *other);
|
||||||
~CPPEditorWidget();
|
~CppEditorWidget();
|
||||||
|
|
||||||
CPPEditorDocument *cppEditorDocument() const;
|
CPPEditorDocument *cppEditorDocument() const;
|
||||||
CppEditorOutline *outline() const;
|
CppEditorOutline *outline() const;
|
||||||
@@ -155,7 +156,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
static bool openCppEditorAt(const Link &, bool inNextSplit = false);
|
static bool openCppEditorAt(const Link &, bool inNextSplit = false);
|
||||||
|
|
||||||
CPPEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
CppEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||||
void ctor();
|
void ctor();
|
||||||
|
|
||||||
void createToolBar(CPPEditor *editable);
|
void createToolBar(CPPEditor *editable);
|
||||||
@@ -174,7 +175,7 @@ private:
|
|||||||
const QList<TextEditor::HighlightingResult> &uses);
|
const QList<TextEditor::HighlightingResult> &uses);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<CPPEditorWidgetPrivate> d;
|
QScopedPointer<CppEditorWidgetPrivate> d;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -42,14 +42,14 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class CppEditor::Internal::CppEditorOutline
|
\class CppEditor::Internal::CppEditorOutline
|
||||||
\brief A helper class of CPPEditorWidget that provides the outline model
|
\brief A helper class of CppEditorWidget that provides the outline model
|
||||||
and widget, e.g. for the editor's tool bar.
|
and widget, e.g. for the editor's tool bar.
|
||||||
|
|
||||||
\internal
|
\internal
|
||||||
|
|
||||||
The caller is responsible for deleting the widget returned by widget().
|
The caller is responsible for deleting the widget returned by widget().
|
||||||
|
|
||||||
\sa CppEditor::Internal::CPPEditorWidget
|
\sa CppEditor::Internal::CppEditorWidget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum { UpdateOutlineIntervalInMs = 500 };
|
enum { UpdateOutlineIntervalInMs = 500 };
|
||||||
@@ -95,7 +95,7 @@ QTimer *newSingleShotTimer(QObject *parent, int msInternal)
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CppEditorOutline::CppEditorOutline(CPPEditorWidget *editorWidget)
|
CppEditorOutline::CppEditorOutline(CppEditorWidget *editorWidget)
|
||||||
: QObject(editorWidget)
|
: QObject(editorWidget)
|
||||||
, m_editorWidget(editorWidget)
|
, m_editorWidget(editorWidget)
|
||||||
, m_combo(new Utils::TreeViewComboBox)
|
, m_combo(new Utils::TreeViewComboBox)
|
||||||
@@ -249,7 +249,7 @@ void CppEditorOutline::gotoSymbolInEditor()
|
|||||||
if (!symbol)
|
if (!symbol)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const TextEditor::BaseTextEditorWidget::Link &link = CPPEditorWidget::linkToSymbol(symbol);
|
const TextEditor::BaseTextEditorWidget::Link &link = CppEditorWidget::linkToSymbol(symbol);
|
||||||
if (!link.hasValidTarget())
|
if (!link.hasValidTarget())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ namespace Utils { class TreeViewComboBox; }
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
|
|
||||||
class CppEditorOutline : public QObject
|
class CppEditorOutline : public QObject
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ class CppEditorOutline : public QObject
|
|||||||
Q_DISABLE_COPY(CppEditorOutline)
|
Q_DISABLE_COPY(CppEditorOutline)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CppEditorOutline(CPPEditorWidget *editorWidget);
|
explicit CppEditorOutline(CppEditorWidget *editorWidget);
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ private:
|
|||||||
const QModelIndex &rootIndex = QModelIndex()) const;
|
const QModelIndex &rootIndex = QModelIndex()) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPEditorWidget *m_editorWidget;
|
CppEditorWidget *m_editorWidget;
|
||||||
|
|
||||||
Utils::TreeViewComboBox *m_combo; // Not owned
|
Utils::TreeViewComboBox *m_combo; // Not owned
|
||||||
CPlusPlus::OverviewModel *m_model;
|
CPlusPlus::OverviewModel *m_model;
|
||||||
|
@@ -97,7 +97,7 @@ CppEditorFactory::CppEditorFactory(CppEditorPlugin *owner) :
|
|||||||
|
|
||||||
IEditor *CppEditorFactory::createEditor()
|
IEditor *CppEditorFactory::createEditor()
|
||||||
{
|
{
|
||||||
CPPEditorWidget *editor = new CPPEditorWidget();
|
CppEditorWidget *editor = new CppEditorWidget();
|
||||||
editor->setRevisionsVisible(true);
|
editor->setRevisionsVisible(true);
|
||||||
m_owner->initializeEditor(editor);
|
m_owner->initializeEditor(editor);
|
||||||
return editor->editor();
|
return editor->editor();
|
||||||
@@ -129,7 +129,7 @@ CppEditorPlugin *CppEditorPlugin::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::initializeEditor(CPPEditorWidget *editor)
|
void CppEditorPlugin::initializeEditor(CppEditorWidget *editor)
|
||||||
{
|
{
|
||||||
editor->setLanguageSettingsId(CppTools::Constants::CPP_SETTINGS_ID);
|
editor->setLanguageSettingsId(CppTools::Constants::CPP_SETTINGS_ID);
|
||||||
TextEditor::TextEditorSettings::initializeEditor(editor);
|
TextEditor::TextEditorSettings::initializeEditor(editor);
|
||||||
@@ -343,38 +343,38 @@ ExtensionSystem::IPlugin::ShutdownFlag CppEditorPlugin::aboutToShutdown()
|
|||||||
return SynchronousShutdown;
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CPPEditorWidget *currentCppEditorWidget()
|
static CppEditorWidget *currentCppEditorWidget()
|
||||||
{
|
{
|
||||||
return qobject_cast<CPPEditorWidget*>(EditorManager::currentEditor()->widget());
|
return qobject_cast<CppEditorWidget*>(EditorManager::currentEditor()->widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::switchDeclarationDefinition()
|
void CppEditorPlugin::switchDeclarationDefinition()
|
||||||
{
|
{
|
||||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||||
editorWidget->switchDeclarationDefinition(/*inNextSplit*/ false);
|
editorWidget->switchDeclarationDefinition(/*inNextSplit*/ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::openDeclarationDefinitionInNextSplit()
|
void CppEditorPlugin::openDeclarationDefinitionInNextSplit()
|
||||||
{
|
{
|
||||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||||
editorWidget->switchDeclarationDefinition(/*inNextSplit*/ true);
|
editorWidget->switchDeclarationDefinition(/*inNextSplit*/ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::renameSymbolUnderCursor()
|
void CppEditorPlugin::renameSymbolUnderCursor()
|
||||||
{
|
{
|
||||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||||
editorWidget->renameSymbolUnderCursor();
|
editorWidget->renameSymbolUnderCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::findUsages()
|
void CppEditorPlugin::findUsages()
|
||||||
{
|
{
|
||||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||||
editorWidget->findUsages();
|
editorWidget->findUsages();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::showPreProcessorDialog()
|
void CppEditorPlugin::showPreProcessorDialog()
|
||||||
{
|
{
|
||||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||||
editorWidget->showPreProcessorWidget();
|
editorWidget->showPreProcessorWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ namespace TextEditor { class BaseTextEditor; }
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class CppCodeModelInspectorDialog;
|
class CppCodeModelInspectorDialog;
|
||||||
class CppQuickFixCollector;
|
class CppQuickFixCollector;
|
||||||
class CppQuickFixAssistProvider;
|
class CppQuickFixAssistProvider;
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
ShutdownFlag aboutToShutdown();
|
ShutdownFlag aboutToShutdown();
|
||||||
|
|
||||||
// Connect editor to settings changed signals.
|
// Connect editor to settings changed signals.
|
||||||
void initializeEditor(CPPEditorWidget *editor);
|
void initializeEditor(CppEditorWidget *editor);
|
||||||
|
|
||||||
bool sortedOutline() const;
|
bool sortedOutline() const;
|
||||||
|
|
||||||
|
@@ -63,14 +63,14 @@ TestCase::~TestCase()
|
|||||||
|
|
||||||
bool TestCase::openCppEditor(const QString &fileName,
|
bool TestCase::openCppEditor(const QString &fileName,
|
||||||
Internal::CPPEditor **editor,
|
Internal::CPPEditor **editor,
|
||||||
Internal::CPPEditorWidget **editorWidget)
|
Internal::CppEditorWidget **editorWidget)
|
||||||
{
|
{
|
||||||
using namespace CppEditor::Internal;
|
using namespace CppEditor::Internal;
|
||||||
if (CPPEditor *e = dynamic_cast<CPPEditor *>(Core::EditorManager::openEditor(fileName))) {
|
if (CPPEditor *e = dynamic_cast<CPPEditor *>(Core::EditorManager::openEditor(fileName))) {
|
||||||
if (editor)
|
if (editor)
|
||||||
*editor = e;
|
*editor = e;
|
||||||
if (editorWidget) {
|
if (editorWidget) {
|
||||||
if (CPPEditorWidget *w = dynamic_cast<CPPEditorWidget *>(e->editorWidget())) {
|
if (CppEditorWidget *w = dynamic_cast<CppEditorWidget *>(e->editorWidget())) {
|
||||||
*editorWidget = w;
|
*editorWidget = w;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -85,7 +85,7 @@ bool TestCase::openCppEditor(const QString &fileName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CPlusPlus::Document::Ptr TestCase::waitForRehighlightedSemanticDocument(
|
CPlusPlus::Document::Ptr TestCase::waitForRehighlightedSemanticDocument(
|
||||||
Internal::CPPEditorWidget *editorWidget)
|
Internal::CppEditorWidget *editorWidget)
|
||||||
{
|
{
|
||||||
editorWidget->semanticRehighlight(true);
|
editorWidget->semanticRehighlight(true);
|
||||||
while (editorWidget->semanticInfo().doc.isNull())
|
while (editorWidget->semanticInfo().doc.isNull())
|
||||||
|
@@ -39,7 +39,7 @@ namespace CppEditor {
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class CPPEditor;
|
class CPPEditor;
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests {
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
int m_cursorPosition;
|
int m_cursorPosition;
|
||||||
Internal::CPPEditor *m_editor;
|
Internal::CPPEditor *m_editor;
|
||||||
Internal::CPPEditorWidget *m_editorWidget;
|
Internal::CppEditorWidget *m_editorWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestCase : public CppTools::Tests::TestCase
|
class TestCase : public CppTools::Tests::TestCase
|
||||||
@@ -64,10 +64,10 @@ public:
|
|||||||
|
|
||||||
static bool openCppEditor(const QString &fileName,
|
static bool openCppEditor(const QString &fileName,
|
||||||
Internal::CPPEditor **editor,
|
Internal::CPPEditor **editor,
|
||||||
Internal::CPPEditorWidget **editorWidget = 0);
|
Internal::CppEditorWidget **editorWidget = 0);
|
||||||
|
|
||||||
static CPlusPlus::Document::Ptr waitForRehighlightedSemanticDocument(
|
static CPlusPlus::Document::Ptr waitForRehighlightedSemanticDocument(
|
||||||
Internal::CPPEditorWidget *editorWidget);
|
Internal::CppEditorWidget *editorWidget);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Tests
|
} // namespace Tests
|
||||||
|
@@ -301,7 +301,7 @@ CppDeclarableElement::CppDeclarableElement(Symbol *declaration)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tooltip = overview.prettyType(declaration->type(), qualifiedName);
|
tooltip = overview.prettyType(declaration->type(), qualifiedName);
|
||||||
link = CPPEditorWidget::linkToSymbol(declaration);
|
link = CppEditorWidget::linkToSymbol(declaration);
|
||||||
helpMark = name;
|
helpMark = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ namespace CppTools { class CppModelManagerInterface; }
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class CppElement;
|
class CppElement;
|
||||||
|
|
||||||
class CppElementEvaluator
|
class CppElementEvaluator
|
||||||
|
@@ -306,8 +306,8 @@ inline LookupItem skipForwardDeclarations(const QList<LookupItem> &resolvedSymbo
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
|
CppEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
|
||||||
CPPEditorWidget *, CPlusPlus::Snapshot snapshot, const CPlusPlus::Document::Ptr &document,
|
CppEditorWidget *, CPlusPlus::Snapshot snapshot, const CPlusPlus::Document::Ptr &document,
|
||||||
SymbolFinder *symbolFinder)
|
SymbolFinder *symbolFinder)
|
||||||
{
|
{
|
||||||
Link result;
|
Link result;
|
||||||
@@ -365,7 +365,7 @@ CPPEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
result = CPPEditorWidget::linkToSymbol(target);
|
result = CppEditorWidget::linkToSymbol(target);
|
||||||
|
|
||||||
unsigned startLine, startColumn, endLine, endColumn;
|
unsigned startLine, startColumn, endLine, endColumn;
|
||||||
document->translationUnit()->getTokenStartPosition(name->firstToken(), &startLine,
|
document->translationUnit()->getTokenStartPosition(name->firstToken(), &startLine,
|
||||||
@@ -396,7 +396,7 @@ Symbol *findDefinition(Symbol *symbol, const Snapshot &snapshot, SymbolFinder *s
|
|||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
FollowSymbolUnderCursor::FollowSymbolUnderCursor(CPPEditorWidget *widget)
|
FollowSymbolUnderCursor::FollowSymbolUnderCursor(CppEditorWidget *widget)
|
||||||
: m_widget(widget)
|
: m_widget(widget)
|
||||||
, m_virtualFunctionAssistProvider(new VirtualFunctionAssistProvider)
|
, m_virtualFunctionAssistProvider(new VirtualFunctionAssistProvider)
|
||||||
{
|
{
|
||||||
@@ -592,7 +592,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
|||||||
const Macro *macro = doc->findMacroDefinitionAt(line);
|
const Macro *macro = doc->findMacroDefinitionAt(line);
|
||||||
if (macro) {
|
if (macro) {
|
||||||
QTextCursor macroCursor = cursor;
|
QTextCursor macroCursor = cursor;
|
||||||
const QByteArray name = CPPEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
const QByteArray name = CppEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
||||||
if (macro->name() == name)
|
if (macro->name() == name)
|
||||||
return link; //already on definition!
|
return link; //already on definition!
|
||||||
} else if (const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1)) {
|
} else if (const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1)) {
|
||||||
@@ -723,7 +723,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
|||||||
|
|
||||||
// Handle macro uses
|
// Handle macro uses
|
||||||
QTextCursor macroCursor = cursor;
|
QTextCursor macroCursor = cursor;
|
||||||
const QByteArray name = CPPEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
const QByteArray name = CppEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
||||||
link = findMacroLink(name, documentFromSemanticInfo);
|
link = findMacroLink(name, documentFromSemanticInfo);
|
||||||
if (link.hasValidTarget()) {
|
if (link.hasValidTarget()) {
|
||||||
link.linkTextStart = macroCursor.selectionStart();
|
link.linkTextStart = macroCursor.selectionStart();
|
||||||
|
@@ -43,7 +43,7 @@ namespace CppTools { class SymbolFinder; }
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class VirtualFunctionAssistProvider;
|
class VirtualFunctionAssistProvider;
|
||||||
|
|
||||||
class FollowSymbolUnderCursor
|
class FollowSymbolUnderCursor
|
||||||
@@ -51,7 +51,7 @@ class FollowSymbolUnderCursor
|
|||||||
public:
|
public:
|
||||||
typedef TextEditor::BaseTextEditorWidget::Link Link;
|
typedef TextEditor::BaseTextEditorWidget::Link Link;
|
||||||
|
|
||||||
FollowSymbolUnderCursor(CPPEditorWidget *widget);
|
FollowSymbolUnderCursor(CppEditorWidget *widget);
|
||||||
~FollowSymbolUnderCursor();
|
~FollowSymbolUnderCursor();
|
||||||
|
|
||||||
Link findLink(const QTextCursor &cursor, bool resolveTarget,
|
Link findLink(const QTextCursor &cursor, bool resolveTarget,
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
void setVirtualFunctionAssistProvider(VirtualFunctionAssistProvider *provider);
|
void setVirtualFunctionAssistProvider(VirtualFunctionAssistProvider *provider);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPEditorWidget *m_widget;
|
CppEditorWidget *m_widget;
|
||||||
VirtualFunctionAssistProvider *m_virtualFunctionAssistProvider;
|
VirtualFunctionAssistProvider *m_virtualFunctionAssistProvider;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -287,7 +287,7 @@ static bool namesEqual(const Name *n1, const Name *n2)
|
|||||||
return n1 == n2 || (n1 && n2 && n1->match(n2));
|
return n1 == n2 || (n1 && n2 && n1->match(n2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionDeclDefLink::apply(CPPEditorWidget *editor, bool jumpToMatch)
|
void FunctionDeclDefLink::apply(CppEditorWidget *editor, bool jumpToMatch)
|
||||||
{
|
{
|
||||||
Snapshot snapshot = editor->semanticInfo().snapshot;
|
Snapshot snapshot = editor->semanticInfo().snapshot;
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ static QList<TextEditor::RefactorMarker> removeMarkersOfType(const QList<TextEdi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionDeclDefLink::hideMarker(CPPEditorWidget *editor)
|
void FunctionDeclDefLink::hideMarker(CppEditorWidget *editor)
|
||||||
{
|
{
|
||||||
if (!hasMarker)
|
if (!hasMarker)
|
||||||
return;
|
return;
|
||||||
@@ -332,7 +332,7 @@ void FunctionDeclDefLink::hideMarker(CPPEditorWidget *editor)
|
|||||||
hasMarker = false;
|
hasMarker = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionDeclDefLink::showMarker(CPPEditorWidget *editor)
|
void FunctionDeclDefLink::showMarker(CppEditorWidget *editor)
|
||||||
{
|
{
|
||||||
if (hasMarker)
|
if (hasMarker)
|
||||||
return;
|
return;
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class FunctionDeclDefLink;
|
class FunctionDeclDefLink;
|
||||||
|
|
||||||
class FunctionDeclDefLinkFinder : public QObject
|
class FunctionDeclDefLinkFinder : public QObject
|
||||||
@@ -80,9 +80,9 @@ public:
|
|||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
bool isMarkerVisible() const;
|
bool isMarkerVisible() const;
|
||||||
|
|
||||||
void apply(CPPEditorWidget *editor, bool jumpToMatch);
|
void apply(CppEditorWidget *editor, bool jumpToMatch);
|
||||||
void hideMarker(CPPEditorWidget *editor);
|
void hideMarker(CppEditorWidget *editor);
|
||||||
void showMarker(CPPEditorWidget *editor);
|
void showMarker(CppEditorWidget *editor);
|
||||||
Utils::ChangeSet changes(const CPlusPlus::Snapshot &snapshot, int targetOffset = -1);
|
Utils::ChangeSet changes(const CPlusPlus::Snapshot &snapshot, int targetOffset = -1);
|
||||||
|
|
||||||
QTextCursor linkSelection;
|
QTextCursor linkSelection;
|
||||||
|
@@ -38,7 +38,7 @@ namespace CppEditor {
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
|
|
||||||
class CppHighlighter : public TextEditor::SyntaxHighlighter
|
class CppHighlighter : public TextEditor::SyntaxHighlighter
|
||||||
{
|
{
|
||||||
|
@@ -67,7 +67,7 @@ public:
|
|||||||
void setup(const QString &fileName, const QString &filePath)
|
void setup(const QString &fileName, const QString &filePath)
|
||||||
{
|
{
|
||||||
setText(fileName);
|
setText(fileName);
|
||||||
m_link = CPPEditorWidget::Link(filePath);
|
m_link = CppEditorWidget::Link(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -82,7 +82,7 @@ private:
|
|||||||
Constants::CPPEDITOR_ID);
|
Constants::CPPEDITOR_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::Link m_link;
|
CppEditorWidget::Link m_link;
|
||||||
};
|
};
|
||||||
|
|
||||||
// CppIncludeHierarchyWidget
|
// CppIncludeHierarchyWidget
|
||||||
@@ -138,7 +138,7 @@ void CppIncludeHierarchyWidget::perform()
|
|||||||
if (!m_editor)
|
if (!m_editor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CPPEditorWidget *widget = qobject_cast<CPPEditorWidget *>(m_editor->widget());
|
CppEditorWidget *widget = qobject_cast<CppEditorWidget *>(m_editor->widget());
|
||||||
if (!widget)
|
if (!widget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ namespace CppEditor {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditor;
|
class CPPEditor;
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class CppInclude;
|
class CppInclude;
|
||||||
class CppIncludeLabel;
|
class CppIncludeLabel;
|
||||||
class CppIncludeHierarchyModel;
|
class CppIncludeHierarchyModel;
|
||||||
@@ -79,7 +79,7 @@ private:
|
|||||||
void showNoIncludeHierarchyLabel();
|
void showNoIncludeHierarchyLabel();
|
||||||
void showIncludeHierarchy();
|
void showIncludeHierarchy();
|
||||||
|
|
||||||
CPPEditorWidget *m_cppEditor;
|
CppEditorWidget *m_cppEditor;
|
||||||
CppIncludeHierarchyTreeView *m_treeView;
|
CppIncludeHierarchyTreeView *m_treeView;
|
||||||
CppIncludeHierarchyModel *m_model;
|
CppIncludeHierarchyModel *m_model;
|
||||||
Utils::AnnotatedItemDelegate *m_delegate;
|
Utils::AnnotatedItemDelegate *m_delegate;
|
||||||
|
@@ -36,16 +36,16 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class CppEditor::Internal::CppLocalRenaming
|
\class CppEditor::Internal::CppLocalRenaming
|
||||||
\brief A helper class of CPPEditorWidget that implements renaming local usages.
|
\brief A helper class of CppEditorWidget that implements renaming local usages.
|
||||||
|
|
||||||
\internal
|
\internal
|
||||||
|
|
||||||
Local use selections must be first set/updated with updateLocalUseSelections().
|
Local use selections must be first set/updated with updateLocalUseSelections().
|
||||||
Afterwards the local renaming can be started with start(). The CPPEditorWidget
|
Afterwards the local renaming can be started with start(). The CppEditorWidget
|
||||||
can then delegate work related to the local renaming mode to the handle*
|
can then delegate work related to the local renaming mode to the handle*
|
||||||
functions.
|
functions.
|
||||||
|
|
||||||
\sa CppEditor::Internal::CPPEditorWidget
|
\sa CppEditor::Internal::CppEditorWidget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@@ -90,7 +90,7 @@ bool CppOutlineFilterModel::filterAcceptsRow(int sourceRow,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CppOutlineWidget::CppOutlineWidget(CPPEditorWidget *editor) :
|
CppOutlineWidget::CppOutlineWidget(CppEditorWidget *editor) :
|
||||||
TextEditor::IOutlineWidget(),
|
TextEditor::IOutlineWidget(),
|
||||||
m_editor(editor),
|
m_editor(editor),
|
||||||
m_treeView(new CppOutlineTreeView(this)),
|
m_treeView(new CppOutlineTreeView(this)),
|
||||||
@@ -193,7 +193,7 @@ bool CppOutlineWidgetFactory::supportsEditor(Core::IEditor *editor) const
|
|||||||
TextEditor::IOutlineWidget *CppOutlineWidgetFactory::createWidget(Core::IEditor *editor)
|
TextEditor::IOutlineWidget *CppOutlineWidgetFactory::createWidget(Core::IEditor *editor)
|
||||||
{
|
{
|
||||||
CPPEditor *cppEditor = qobject_cast<CPPEditor*>(editor);
|
CPPEditor *cppEditor = qobject_cast<CPPEditor*>(editor);
|
||||||
CPPEditorWidget *cppEditorWidget = qobject_cast<CPPEditorWidget*>(cppEditor->widget());
|
CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget*>(cppEditor->widget());
|
||||||
QTC_ASSERT(cppEditorWidget, return 0);
|
QTC_ASSERT(cppEditorWidget, return 0);
|
||||||
|
|
||||||
CppOutlineWidget *widget = new CppOutlineWidget(cppEditorWidget);
|
CppOutlineWidget *widget = new CppOutlineWidget(cppEditorWidget);
|
||||||
|
@@ -68,7 +68,7 @@ class CppOutlineWidget : public TextEditor::IOutlineWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CppOutlineWidget(CPPEditorWidget *editor);
|
CppOutlineWidget(CppEditorWidget *editor);
|
||||||
|
|
||||||
// IOutlineWidget
|
// IOutlineWidget
|
||||||
virtual QList<QAction*> filterMenuActions() const;
|
virtual QList<QAction*> filterMenuActions() const;
|
||||||
@@ -84,7 +84,7 @@ private:
|
|||||||
bool syncCursor();
|
bool syncCursor();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPEditorWidget *m_editor;
|
CppEditorWidget *m_editor;
|
||||||
CppOutlineTreeView *m_treeView;
|
CppOutlineTreeView *m_treeView;
|
||||||
CPlusPlus::OverviewModel *m_model;
|
CPlusPlus::OverviewModel *m_model;
|
||||||
CppOutlineFilterModel *m_proxyModel;
|
CppOutlineFilterModel *m_proxyModel;
|
||||||
|
@@ -251,7 +251,7 @@ private:
|
|||||||
|
|
||||||
/// Apply the factory on the source and get back the resultIndex'th result or a null pointer.
|
/// Apply the factory on the source and get back the resultIndex'th result or a null pointer.
|
||||||
QSharedPointer<TextEditor::QuickFixOperation> QuickFixTestCase::getFix(
|
QSharedPointer<TextEditor::QuickFixOperation> QuickFixTestCase::getFix(
|
||||||
CppQuickFixFactory *factory, CPPEditorWidget *editorWidget, int resultIndex)
|
CppQuickFixFactory *factory, CppEditorWidget *editorWidget, int resultIndex)
|
||||||
{
|
{
|
||||||
CppQuickFixInterface qfi(new CppQuickFixAssistInterface(editorWidget, ExplicitlyInvoked));
|
CppQuickFixInterface qfi(new CppQuickFixAssistInterface(editorWidget, ExplicitlyInvoked));
|
||||||
TextEditor::QuickFixOperations results;
|
TextEditor::QuickFixOperations results;
|
||||||
|
@@ -84,7 +84,7 @@ public:
|
|||||||
CppQuickFixFactory *factory, const QString &incPath);
|
CppQuickFixFactory *factory, const QString &incPath);
|
||||||
private:
|
private:
|
||||||
QSharedPointer<TextEditor::QuickFixOperation> getFix(CppQuickFixFactory *factory,
|
QSharedPointer<TextEditor::QuickFixOperation> getFix(CppQuickFixFactory *factory,
|
||||||
CPPEditorWidget *editorWidget,
|
CppEditorWidget *editorWidget,
|
||||||
int resultIndex = 0);
|
int resultIndex = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -84,7 +84,7 @@ const IAssistProvider *CppQuickFixAssistProcessor::provider() const
|
|||||||
// --------------------------
|
// --------------------------
|
||||||
// CppQuickFixAssistInterface
|
// CppQuickFixAssistInterface
|
||||||
// --------------------------
|
// --------------------------
|
||||||
CppQuickFixAssistInterface::CppQuickFixAssistInterface(CPPEditorWidget *editor,
|
CppQuickFixAssistInterface::CppQuickFixAssistInterface(CppEditorWidget *editor,
|
||||||
TextEditor::AssistReason reason)
|
TextEditor::AssistReason reason)
|
||||||
: DefaultAssistInterface(editor->document(), editor->position(),
|
: DefaultAssistInterface(editor->document(), editor->position(),
|
||||||
editor->baseTextDocument()->filePath(), reason)
|
editor->baseTextDocument()->filePath(), reason)
|
||||||
@@ -119,7 +119,7 @@ const LookupContext &CppQuickFixAssistInterface::context() const
|
|||||||
return m_context;
|
return m_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget *CppQuickFixAssistInterface::editor() const
|
CppEditorWidget *CppQuickFixAssistInterface::editor() const
|
||||||
{
|
{
|
||||||
return m_editor;
|
return m_editor;
|
||||||
}
|
}
|
||||||
|
@@ -47,18 +47,18 @@ typedef QSharedPointer<CppRefactoringFile> CppRefactoringFilePtr;
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
|
|
||||||
class CppQuickFixAssistInterface : public TextEditor::DefaultAssistInterface
|
class CppQuickFixAssistInterface : public TextEditor::DefaultAssistInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CppQuickFixAssistInterface(CPPEditorWidget *editor, TextEditor::AssistReason reason);
|
CppQuickFixAssistInterface(CppEditorWidget *editor, TextEditor::AssistReason reason);
|
||||||
|
|
||||||
const QList<CPlusPlus::AST *> &path() const;
|
const QList<CPlusPlus::AST *> &path() const;
|
||||||
CPlusPlus::Snapshot snapshot() const;
|
CPlusPlus::Snapshot snapshot() const;
|
||||||
CppTools::SemanticInfo semanticInfo() const;
|
CppTools::SemanticInfo semanticInfo() const;
|
||||||
const CPlusPlus::LookupContext &context() const;
|
const CPlusPlus::LookupContext &context() const;
|
||||||
CPPEditorWidget *editor() const;
|
CppEditorWidget *editor() const;
|
||||||
|
|
||||||
CppTools::CppRefactoringFilePtr currentFile() const;
|
CppTools::CppRefactoringFilePtr currentFile() const;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
bool isCursorOn(const CPlusPlus::AST *ast) const;
|
bool isCursorOn(const CPlusPlus::AST *ast) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPEditorWidget *m_editor;
|
CppEditorWidget *m_editor;
|
||||||
CppTools::SemanticInfo m_semanticInfo;
|
CppTools::SemanticInfo m_semanticInfo;
|
||||||
CPlusPlus::Snapshot m_snapshot;
|
CPlusPlus::Snapshot m_snapshot;
|
||||||
CppTools::CppRefactoringFilePtr m_currentFile;
|
CppTools::CppRefactoringFilePtr m_currentFile;
|
||||||
|
@@ -4091,7 +4091,7 @@ public:
|
|||||||
|
|
||||||
void perform()
|
void perform()
|
||||||
{
|
{
|
||||||
CPPEditorWidget *editor = assistInterface()->editor();
|
CppEditorWidget *editor = assistInterface()->editor();
|
||||||
QSharedPointer<FunctionDeclDefLink> link = editor->declDefLink();
|
QSharedPointer<FunctionDeclDefLink> link = editor->declDefLink();
|
||||||
if (link == m_link)
|
if (link == m_link)
|
||||||
editor->applyDeclDefLinkChanges(/*don't jump*/false);
|
editor->applyDeclDefLinkChanges(/*don't jump*/false);
|
||||||
|
@@ -65,7 +65,7 @@ QStandardItem *itemForClass(const CppClass &cppClass)
|
|||||||
item->setData(cppClass.qualifiedName, AnnotationRole);
|
item->setData(cppClass.qualifiedName, AnnotationRole);
|
||||||
item->setData(cppClass.icon, Qt::DecorationRole);
|
item->setData(cppClass.icon, Qt::DecorationRole);
|
||||||
QVariant link;
|
QVariant link;
|
||||||
link.setValue(CPPEditorWidget::Link(cppClass.link));
|
link.setValue(CppEditorWidget::Link(cppClass.link));
|
||||||
item->setData(link, LinkRole);
|
item->setData(link, LinkRole);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public:
|
|||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
QLabel::clear();
|
QLabel::clear();
|
||||||
m_link = CPPEditorWidget::Link();
|
m_link = CppEditorWidget::Link();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -117,7 +117,7 @@ private:
|
|||||||
Constants::CPPEDITOR_ID);
|
Constants::CPPEDITOR_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditorWidget::Link m_link;
|
CppEditorWidget::Link m_link;
|
||||||
};
|
};
|
||||||
|
|
||||||
// CppTypeHierarchyWidget
|
// CppTypeHierarchyWidget
|
||||||
@@ -174,7 +174,7 @@ void CppTypeHierarchyWidget::perform()
|
|||||||
if (!editor)
|
if (!editor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CPPEditorWidget *widget = qobject_cast<CPPEditorWidget *>(editor->widget());
|
CppEditorWidget *widget = qobject_cast<CppEditorWidget *>(editor->widget());
|
||||||
if (!widget)
|
if (!widget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ class AnnotatedItemDelegate;
|
|||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CPPEditorWidget;
|
class CppEditorWidget;
|
||||||
class CppClass;
|
class CppClass;
|
||||||
class CppClassLabel;
|
class CppClassLabel;
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ private:
|
|||||||
void showTypeHierarchy();
|
void showTypeHierarchy();
|
||||||
void clearTypeHierarchy();
|
void clearTypeHierarchy();
|
||||||
|
|
||||||
CPPEditorWidget *m_cppEditor;
|
CppEditorWidget *m_cppEditor;
|
||||||
Utils::NavigationTreeView *m_treeView;
|
Utils::NavigationTreeView *m_treeView;
|
||||||
QWidget *m_hierarchyWidget;
|
QWidget *m_hierarchyWidget;
|
||||||
QStackedLayout *m_stackLayout;
|
QStackedLayout *m_stackLayout;
|
||||||
|
@@ -132,7 +132,7 @@ public:
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(m_params.function, return 0);
|
QTC_ASSERT(m_params.function, return 0);
|
||||||
|
|
||||||
BasicProposalItem *hintItem = new VirtualFunctionProposalItem(CPPEditorWidget::Link());
|
BasicProposalItem *hintItem = new VirtualFunctionProposalItem(CppEditorWidget::Link());
|
||||||
hintItem->setText(QCoreApplication::translate("VirtualFunctionsAssistProcessor",
|
hintItem->setText(QCoreApplication::translate("VirtualFunctionsAssistProcessor",
|
||||||
"...searching overrides"));
|
"...searching overrides"));
|
||||||
hintItem->setOrder(-1000);
|
hintItem->setOrder(-1000);
|
||||||
@@ -181,7 +181,7 @@ private:
|
|||||||
|
|
||||||
BasicProposalItem *itemFromFunction(Function *func) const
|
BasicProposalItem *itemFromFunction(Function *func) const
|
||||||
{
|
{
|
||||||
const CPPEditorWidget::Link link = CPPEditorWidget::linkToSymbol(maybeDefinitionFor(func));
|
const CppEditorWidget::Link link = CppEditorWidget::linkToSymbol(maybeDefinitionFor(func));
|
||||||
QString text = m_overview.prettyName(LookupContext::fullyQualifiedName(func));
|
QString text = m_overview.prettyName(LookupContext::fullyQualifiedName(func));
|
||||||
if (func->isPureVirtual())
|
if (func->isPureVirtual())
|
||||||
text += QLatin1String(" = 0");
|
text += QLatin1String(" = 0");
|
||||||
|
@@ -92,7 +92,7 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Every Action is expected to undo its changes.
|
/// Every Action is expected to undo its changes.
|
||||||
virtual void run(CPPEditorWidget *editorWidget) = 0;
|
virtual void run(CppEditorWidget *editorWidget) = 0;
|
||||||
virtual ~AbstractAction() {}
|
virtual ~AbstractAction() {}
|
||||||
};
|
};
|
||||||
typedef QSharedPointer<AbstractAction> ActionPointer;
|
typedef QSharedPointer<AbstractAction> ActionPointer;
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
static void undoChangesInAllEditorWidgets();
|
static void undoChangesInAllEditorWidgets();
|
||||||
|
|
||||||
/// Execute actions for the current cursor position of editorWidget.
|
/// Execute actions for the current cursor position of editorWidget.
|
||||||
static void executeActionsOnEditorWidget(CPPEditorWidget *editorWidget, Actions actions);
|
static void executeActionsOnEditorWidget(CppEditorWidget *editorWidget, Actions actions);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Move word camel case wise from current cursor position until given token (not included)
|
/// Move word camel case wise from current cursor position until given token (not included)
|
||||||
@@ -187,7 +187,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti
|
|||||||
// Open editor
|
// Open editor
|
||||||
QCOMPARE(DocumentModel::openedDocuments().size(), 0);
|
QCOMPARE(DocumentModel::openedDocuments().size(), 0);
|
||||||
CPPEditor *editor;
|
CPPEditor *editor;
|
||||||
CPPEditorWidget *editorWidget;
|
CppEditorWidget *editorWidget;
|
||||||
QVERIFY(openCppEditor(filePath, &editor, &editorWidget));
|
QVERIFY(openCppEditor(filePath, &editor, &editorWidget));
|
||||||
|
|
||||||
QCOMPARE(DocumentModel::openedDocuments().size(), 1);
|
QCOMPARE(DocumentModel::openedDocuments().size(), 1);
|
||||||
@@ -276,7 +276,7 @@ void TestActionsTestCase::undoChangesInAllEditorWidgets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestActionsTestCase::executeActionsOnEditorWidget(CPPEditorWidget *editorWidget,
|
void TestActionsTestCase::executeActionsOnEditorWidget(CppEditorWidget *editorWidget,
|
||||||
TestActionsTestCase::Actions actions)
|
TestActionsTestCase::Actions actions)
|
||||||
{
|
{
|
||||||
foreach (const ActionPointer &action, actions)
|
foreach (const ActionPointer &action, actions)
|
||||||
@@ -291,7 +291,7 @@ void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationU
|
|||||||
{
|
{
|
||||||
QVERIFY(translationUnit);
|
QVERIFY(translationUnit);
|
||||||
QVERIFY(editor);
|
QVERIFY(editor);
|
||||||
CPPEditorWidget *editorWidget = dynamic_cast<CPPEditorWidget *>(editor->editorWidget());
|
CppEditorWidget *editorWidget = dynamic_cast<CppEditorWidget *>(editor->editorWidget());
|
||||||
QVERIFY(editorWidget);
|
QVERIFY(editorWidget);
|
||||||
|
|
||||||
unsigned line, column;
|
unsigned line, column;
|
||||||
@@ -329,7 +329,7 @@ class NoOpTokenAction : public TestActionsTestCase::AbstractAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Do nothing on each token
|
/// Do nothing on each token
|
||||||
void run(CPPEditorWidget *) {}
|
void run(CppEditorWidget *) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractAction
|
class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractAction
|
||||||
@@ -337,10 +337,10 @@ class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA
|
|||||||
public:
|
public:
|
||||||
/// Follow symbol under cursor
|
/// Follow symbol under cursor
|
||||||
/// Warning: May block if file does not exists (e.g. a not generated ui_* file).
|
/// Warning: May block if file does not exists (e.g. a not generated ui_* file).
|
||||||
void run(CPPEditorWidget *editorWidget);
|
void run(CppEditorWidget *editorWidget);
|
||||||
};
|
};
|
||||||
|
|
||||||
void FollowSymbolUnderCursorTokenAction::run(CPPEditorWidget *editorWidget)
|
void FollowSymbolUnderCursorTokenAction::run(CppEditorWidget *editorWidget)
|
||||||
{
|
{
|
||||||
// Follow link
|
// Follow link
|
||||||
IEditor *editorBefore = EditorManager::currentEditor();
|
IEditor *editorBefore = EditorManager::currentEditor();
|
||||||
@@ -363,10 +363,10 @@ class SwitchDeclarationDefinitionTokenAction : public TestActionsTestCase::Abstr
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Switch Declaration/Definition on each token
|
/// Switch Declaration/Definition on each token
|
||||||
void run(CPPEditorWidget *);
|
void run(CppEditorWidget *);
|
||||||
};
|
};
|
||||||
|
|
||||||
void SwitchDeclarationDefinitionTokenAction::run(CPPEditorWidget *)
|
void SwitchDeclarationDefinitionTokenAction::run(CppEditorWidget *)
|
||||||
{
|
{
|
||||||
// Switch Declaration/Definition
|
// Switch Declaration/Definition
|
||||||
IEditor *editorBefore = EditorManager::currentEditor();
|
IEditor *editorBefore = EditorManager::currentEditor();
|
||||||
@@ -388,10 +388,10 @@ class FindUsagesTokenAction : public TestActionsTestCase::AbstractAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Find Usages on each token
|
/// Find Usages on each token
|
||||||
void run(CPPEditorWidget *);
|
void run(CppEditorWidget *);
|
||||||
};
|
};
|
||||||
|
|
||||||
void FindUsagesTokenAction::run(CPPEditorWidget *)
|
void FindUsagesTokenAction::run(CppEditorWidget *)
|
||||||
{
|
{
|
||||||
CppEditor::Internal::CppEditorPlugin::instance()->findUsages();
|
CppEditor::Internal::CppEditorPlugin::instance()->findUsages();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@@ -401,10 +401,10 @@ class RenameSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Rename Symbol Under Cursor on each token (Renaming is not applied)
|
/// Rename Symbol Under Cursor on each token (Renaming is not applied)
|
||||||
void run(CPPEditorWidget *);
|
void run(CppEditorWidget *);
|
||||||
};
|
};
|
||||||
|
|
||||||
void RenameSymbolUnderCursorTokenAction::run(CPPEditorWidget *)
|
void RenameSymbolUnderCursorTokenAction::run(CppEditorWidget *)
|
||||||
{
|
{
|
||||||
CppEditor::Internal::CppEditorPlugin::instance()->renameSymbolUnderCursor();
|
CppEditor::Internal::CppEditorPlugin::instance()->renameSymbolUnderCursor();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@@ -414,10 +414,10 @@ class OpenTypeHierarchyTokenAction : public TestActionsTestCase::AbstractAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Open Type Hierarchy on each token
|
/// Open Type Hierarchy on each token
|
||||||
void run(CPPEditorWidget *);
|
void run(CppEditorWidget *);
|
||||||
};
|
};
|
||||||
|
|
||||||
void OpenTypeHierarchyTokenAction::run(CPPEditorWidget *)
|
void OpenTypeHierarchyTokenAction::run(CppEditorWidget *)
|
||||||
{
|
{
|
||||||
CppEditor::Internal::CppEditorPlugin::instance()->openTypeHierarchy();
|
CppEditor::Internal::CppEditorPlugin::instance()->openTypeHierarchy();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@@ -428,10 +428,10 @@ class InvokeCompletionTokenAction : public TestActionsTestCase::AbstractAction
|
|||||||
public:
|
public:
|
||||||
/// Invoke completion menu on each token.
|
/// Invoke completion menu on each token.
|
||||||
/// Warning: May create tool tip artefacts if focus is lost.
|
/// Warning: May create tool tip artefacts if focus is lost.
|
||||||
void run(CPPEditorWidget *editorWidget);
|
void run(CppEditorWidget *editorWidget);
|
||||||
};
|
};
|
||||||
|
|
||||||
void InvokeCompletionTokenAction::run(CPPEditorWidget *editorWidget)
|
void InvokeCompletionTokenAction::run(CppEditorWidget *editorWidget)
|
||||||
{
|
{
|
||||||
// Invoke assistant and wait until it is finished
|
// Invoke assistant and wait until it is finished
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
@@ -454,11 +454,11 @@ class RunAllQuickFixesTokenAction : public TestActionsTestCase::AbstractAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Trigger all Quick Fixes and apply the matching ones
|
/// Trigger all Quick Fixes and apply the matching ones
|
||||||
void run(CPPEditorWidget *editorWidget);
|
void run(CppEditorWidget *editorWidget);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Some QuickFixes operate on selections.
|
// TODO: Some QuickFixes operate on selections.
|
||||||
void RunAllQuickFixesTokenAction::run(CPPEditorWidget *editorWidget)
|
void RunAllQuickFixesTokenAction::run(CppEditorWidget *editorWidget)
|
||||||
{
|
{
|
||||||
// Calling editorWidget->invokeAssist(QuickFix) would be not enough
|
// Calling editorWidget->invokeAssist(QuickFix) would be not enough
|
||||||
// since we also want to execute the ones that match.
|
// since we also want to execute the ones that match.
|
||||||
@@ -497,10 +497,10 @@ void RunAllQuickFixesTokenAction::run(CPPEditorWidget *editorWidget)
|
|||||||
class SwitchHeaderSourceFileAction : public TestActionsTestCase::AbstractAction
|
class SwitchHeaderSourceFileAction : public TestActionsTestCase::AbstractAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void run(CPPEditorWidget *);
|
void run(CppEditorWidget *);
|
||||||
};
|
};
|
||||||
|
|
||||||
void SwitchHeaderSourceFileAction::run(CPPEditorWidget *)
|
void SwitchHeaderSourceFileAction::run(CppEditorWidget *)
|
||||||
{
|
{
|
||||||
// Switch Header/Source
|
// Switch Header/Source
|
||||||
IEditor *editorBefore = EditorManager::currentEditor();
|
IEditor *editorBefore = EditorManager::currentEditor();
|
||||||
|
@@ -113,7 +113,7 @@ typedef QByteArray _;
|
|||||||
class VirtualFunctionTestAssistProvider : public VirtualFunctionAssistProvider
|
class VirtualFunctionTestAssistProvider : public VirtualFunctionAssistProvider
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VirtualFunctionTestAssistProvider(CPPEditorWidget *editorWidget)
|
VirtualFunctionTestAssistProvider(CppEditorWidget *editorWidget)
|
||||||
: m_editorWidget(editorWidget)
|
: m_editorWidget(editorWidget)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ public:
|
|||||||
OverrideItemList m_finalItems;
|
OverrideItemList m_finalItems;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPEditorWidget *m_editorWidget;
|
CppEditorWidget *m_editorWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestDocument;
|
class TestDocument;
|
||||||
@@ -308,7 +308,7 @@ F2TestCase::F2TestCase(CppEditorAction action,
|
|||||||
// Trigger the action
|
// Trigger the action
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case FollowSymbolUnderCursorAction: {
|
case FollowSymbolUnderCursorAction: {
|
||||||
CPPEditorWidget *widget = initialTestFile->m_editorWidget;
|
CppEditorWidget *widget = initialTestFile->m_editorWidget;
|
||||||
FollowSymbolUnderCursor *delegate = widget->followSymbolUnderCursorDelegate();
|
FollowSymbolUnderCursor *delegate = widget->followSymbolUnderCursorDelegate();
|
||||||
VirtualFunctionAssistProvider *original = delegate->virtualFunctionAssistProvider();
|
VirtualFunctionAssistProvider *original = delegate->virtualFunctionAssistProvider();
|
||||||
|
|
||||||
|
@@ -140,7 +140,7 @@ void Document::addRange(const QTextCursor &cursor, GLSL::Scope *scope)
|
|||||||
_cursors.append(c);
|
_cursors.append(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLSLTextEditorWidget::GLSLTextEditorWidget(QWidget *parent)
|
GlslEditorWidget::GlslEditorWidget(QWidget *parent)
|
||||||
: TextEditor::BaseTextEditorWidget(parent)
|
: TextEditor::BaseTextEditorWidget(parent)
|
||||||
{
|
{
|
||||||
baseTextDocument()->setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
|
baseTextDocument()->setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
|
||||||
@@ -148,13 +148,13 @@ GLSLTextEditorWidget::GLSLTextEditorWidget(QWidget *parent)
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLSLTextEditorWidget::GLSLTextEditorWidget(GLSLTextEditorWidget *other)
|
GlslEditorWidget::GlslEditorWidget(GlslEditorWidget *other)
|
||||||
: TextEditor::BaseTextEditorWidget(other)
|
: TextEditor::BaseTextEditorWidget(other)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSLTextEditorWidget::ctor()
|
void GlslEditorWidget::ctor()
|
||||||
{
|
{
|
||||||
m_outlineCombo = 0;
|
m_outlineCombo = 0;
|
||||||
setParenthesesMatchingEnabled(true);
|
setParenthesesMatchingEnabled(true);
|
||||||
@@ -181,17 +181,17 @@ void GLSLTextEditorWidget::ctor()
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
GLSLTextEditorWidget::~GLSLTextEditorWidget()
|
GlslEditorWidget::~GlslEditorWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int GLSLTextEditorWidget::editorRevision() const
|
int GlslEditorWidget::editorRevision() const
|
||||||
{
|
{
|
||||||
//return document()->revision();
|
//return document()->revision();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLSLTextEditorWidget::isOutdated() const
|
bool GlslEditorWidget::isOutdated() const
|
||||||
{
|
{
|
||||||
// if (m_semanticInfo.revision() != editorRevision())
|
// if (m_semanticInfo.revision() != editorRevision())
|
||||||
// return true;
|
// return true;
|
||||||
@@ -199,27 +199,27 @@ bool GLSLTextEditorWidget::isOutdated() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IEditor *GLSLEditorEditable::duplicate()
|
Core::IEditor *GlslEditor::duplicate()
|
||||||
{
|
{
|
||||||
GLSLTextEditorWidget *newEditor = new GLSLTextEditorWidget(
|
GlslEditorWidget *newEditor = new GlslEditorWidget(
|
||||||
qobject_cast<GLSLTextEditorWidget *>(editorWidget()));
|
qobject_cast<GlslEditorWidget *>(editorWidget()));
|
||||||
TextEditor::TextEditorSettings::initializeEditor(newEditor);
|
TextEditor::TextEditorSettings::initializeEditor(newEditor);
|
||||||
return newEditor->editor();
|
return newEditor->editor();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLSLEditorEditable::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
bool GlslEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||||
{
|
{
|
||||||
baseTextDocument()->setMimeType(Core::MimeDatabase::findByFile(QFileInfo(fileName)).type());
|
baseTextDocument()->setMimeType(Core::MimeDatabase::findByFile(QFileInfo(fileName)).type());
|
||||||
bool b = TextEditor::BaseTextEditor::open(errorString, fileName, realFileName);
|
bool b = TextEditor::BaseTextEditor::open(errorString, fileName, realFileName);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::CompletionAssistProvider *GLSLEditorEditable::completionAssistProvider()
|
TextEditor::CompletionAssistProvider *GlslEditor::completionAssistProvider()
|
||||||
{
|
{
|
||||||
return ExtensionSystem::PluginManager::getObject<GLSLCompletionAssistProvider>();
|
return ExtensionSystem::PluginManager::getObject<GLSLCompletionAssistProvider>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GLSLTextEditorWidget::wordUnderCursor() const
|
QString GlslEditorWidget::wordUnderCursor() const
|
||||||
{
|
{
|
||||||
QTextCursor tc = textCursor();
|
QTextCursor tc = textCursor();
|
||||||
const QChar ch = document()->characterAt(tc.position() - 1);
|
const QChar ch = document()->characterAt(tc.position() - 1);
|
||||||
@@ -232,14 +232,14 @@ QString GLSLTextEditorWidget::wordUnderCursor() const
|
|||||||
return word;
|
return word;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::BaseTextEditor *GLSLTextEditorWidget::createEditor()
|
TextEditor::BaseTextEditor *GlslEditorWidget::createEditor()
|
||||||
{
|
{
|
||||||
GLSLEditorEditable *editable = new GLSLEditorEditable(this);
|
GlslEditor *editable = new GlslEditor(this);
|
||||||
createToolBar(editable);
|
createToolBar(editable);
|
||||||
return editable;
|
return editable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSLTextEditorWidget::createToolBar(GLSLEditorEditable *editor)
|
void GlslEditorWidget::createToolBar(GlslEditor *editor)
|
||||||
{
|
{
|
||||||
m_outlineCombo = new QComboBox;
|
m_outlineCombo = new QComboBox;
|
||||||
m_outlineCombo->setMinimumContentsLength(22);
|
m_outlineCombo->setMinimumContentsLength(22);
|
||||||
@@ -263,12 +263,12 @@ void GLSLTextEditorWidget::createToolBar(GLSLEditorEditable *editor)
|
|||||||
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, m_outlineCombo);
|
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, m_outlineCombo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSLTextEditorWidget::updateDocument()
|
void GlslEditorWidget::updateDocument()
|
||||||
{
|
{
|
||||||
m_updateDocumentTimer->start();
|
m_updateDocumentTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSLTextEditorWidget::updateDocumentNow()
|
void GlslEditorWidget::updateDocumentNow()
|
||||||
{
|
{
|
||||||
m_updateDocumentTimer->stop();
|
m_updateDocumentTimer->stop();
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ void GLSLTextEditorWidget::updateDocumentNow()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GLSLTextEditorWidget::languageVariant(const QString &type)
|
int GlslEditorWidget::languageVariant(const QString &type)
|
||||||
{
|
{
|
||||||
int variant = 0;
|
int variant = 0;
|
||||||
bool isVertex = false;
|
bool isVertex = false;
|
||||||
@@ -371,7 +371,7 @@ int GLSLTextEditorWidget::languageVariant(const QString &type)
|
|||||||
return variant;
|
return variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::IAssistInterface *GLSLTextEditorWidget::createAssistInterface(
|
TextEditor::IAssistInterface *GlslEditorWidget::createAssistInterface(
|
||||||
TextEditor::AssistKind kind,
|
TextEditor::AssistKind kind,
|
||||||
TextEditor::AssistReason reason) const
|
TextEditor::AssistReason reason) const
|
||||||
{
|
{
|
||||||
|
@@ -49,8 +49,8 @@ class Scope;
|
|||||||
namespace GLSLEditor {
|
namespace GLSLEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GLSLEditorEditable;
|
class GlslEditor;
|
||||||
class GLSLTextEditorWidget;
|
class GlslEditorWidget;
|
||||||
|
|
||||||
class Document
|
class Document
|
||||||
{
|
{
|
||||||
@@ -78,17 +78,17 @@ private:
|
|||||||
GLSL::Scope *_globalScope;
|
GLSL::Scope *_globalScope;
|
||||||
QList<Range> _cursors;
|
QList<Range> _cursors;
|
||||||
|
|
||||||
friend class GLSLTextEditorWidget;
|
friend class GlslEditorWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSLTextEditorWidget : public TextEditor::BaseTextEditorWidget
|
class GlslEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GLSLTextEditorWidget(QWidget *parent = 0);
|
GlslEditorWidget(QWidget *parent = 0);
|
||||||
GLSLTextEditorWidget(GLSLTextEditorWidget *other);
|
GlslEditorWidget(GlslEditorWidget *other);
|
||||||
~GLSLTextEditorWidget();
|
~GlslEditorWidget();
|
||||||
|
|
||||||
int editorRevision() const;
|
int editorRevision() const;
|
||||||
bool isOutdated() const;
|
bool isOutdated() const;
|
||||||
@@ -106,10 +106,10 @@ private slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
TextEditor::BaseTextEditor *createEditor();
|
TextEditor::BaseTextEditor *createEditor();
|
||||||
void createToolBar(Internal::GLSLEditorEditable *editable);
|
void createToolBar(Internal::GlslEditor *editable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLSLTextEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
GlslEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||||
void ctor();
|
void ctor();
|
||||||
void setSelectedElements();
|
void setSelectedElements();
|
||||||
QString wordUnderCursor() const;
|
QString wordUnderCursor() const;
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
namespace GLSLEditor {
|
namespace GLSLEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
GLSLEditorEditable::GLSLEditorEditable(GLSLTextEditorWidget *editor)
|
GlslEditor::GlslEditor(GlslEditorWidget *editor)
|
||||||
: BaseTextEditor(editor)
|
: BaseTextEditor(editor)
|
||||||
{
|
{
|
||||||
setContext(Core::Context(GLSLEditor::Constants::C_GLSLEDITOR_ID,
|
setContext(Core::Context(GLSLEditor::Constants::C_GLSLEDITOR_ID,
|
||||||
|
@@ -35,14 +35,14 @@
|
|||||||
namespace GLSLEditor {
|
namespace GLSLEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GLSLTextEditorWidget;
|
class GlslEditorWidget;
|
||||||
|
|
||||||
class GLSLEditorEditable : public TextEditor::BaseTextEditor
|
class GlslEditor : public TextEditor::BaseTextEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GLSLEditorEditable(GLSLTextEditorWidget *);
|
explicit GlslEditor(GlslEditorWidget *);
|
||||||
|
|
||||||
Core::IEditor *duplicate();
|
Core::IEditor *duplicate();
|
||||||
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
|
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
|
||||||
|
@@ -65,7 +65,7 @@ GLSLEditorFactory::GLSLEditorFactory(QObject *parent)
|
|||||||
|
|
||||||
Core::IEditor *GLSLEditorFactory::createEditor()
|
Core::IEditor *GLSLEditorFactory::createEditor()
|
||||||
{
|
{
|
||||||
GLSLTextEditorWidget *rc = new GLSLTextEditorWidget();
|
GlslEditorWidget *rc = new GlslEditorWidget();
|
||||||
TextEditor::TextEditorSettings::initializeEditor(rc);
|
TextEditor::TextEditorSettings::initializeEditor(rc);
|
||||||
return rc->editor();
|
return rc->editor();
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
namespace GLSLEditor {
|
namespace GLSLEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GLSLTextEditorWidget;
|
class GlslEditorWidget;
|
||||||
|
|
||||||
class GLSLEditorPlugin : public ExtensionSystem::IPlugin
|
class GLSLEditorPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
|
@@ -92,7 +92,7 @@ void Highlighter::highlightBlock(const QString &text)
|
|||||||
lex.setState(state);
|
lex.setState(state);
|
||||||
lex.setScanKeywords(false);
|
lex.setScanKeywords(false);
|
||||||
lex.setScanComments(true);
|
lex.setScanComments(true);
|
||||||
const int variant = GLSLTextEditorWidget::languageVariant(parent()
|
const int variant = GlslEditorWidget::languageVariant(parent()
|
||||||
? static_cast<BaseTextDocument*>(parent())->mimeType()
|
? static_cast<BaseTextDocument*>(parent())->mimeType()
|
||||||
: QString());
|
: QString());
|
||||||
lex.setVariant(variant);
|
lex.setVariant(variant);
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
namespace GLSLEditor {
|
namespace GLSLEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GLSLTextEditorWidget;
|
class GlslEditorWidget;
|
||||||
|
|
||||||
class Highlighter : public TextEditor::SyntaxHighlighter
|
class Highlighter : public TextEditor::SyntaxHighlighter
|
||||||
{
|
{
|
||||||
|
@@ -52,14 +52,14 @@ GLSLHoverHandler::~GLSLHoverHandler()
|
|||||||
|
|
||||||
bool GLSLHoverHandler::acceptEditor(IEditor *editor)
|
bool GLSLHoverHandler::acceptEditor(IEditor *editor)
|
||||||
{
|
{
|
||||||
if (qobject_cast<GLSLEditorEditable *>(editor) != 0)
|
if (qobject_cast<GlslEditor *>(editor) != 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSLHoverHandler::identifyMatch(TextEditor::BaseTextEditor *editor, int pos)
|
void GLSLHoverHandler::identifyMatch(TextEditor::BaseTextEditor *editor, int pos)
|
||||||
{
|
{
|
||||||
if (GLSLTextEditorWidget *glslEditor = qobject_cast<GLSLTextEditorWidget *>(editor->widget())) {
|
if (GlslEditorWidget *glslEditor = qobject_cast<GlslEditorWidget *>(editor->widget())) {
|
||||||
if (! glslEditor->extraSelectionTooltip(pos).isEmpty())
|
if (! glslEditor->extraSelectionTooltip(pos).isEmpty())
|
||||||
setToolTip(glslEditor->extraSelectionTooltip(pos));
|
setToolTip(glslEditor->extraSelectionTooltip(pos));
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
namespace PythonEditor {
|
namespace PythonEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
PythonEditor::PythonEditor(EditorWidget *editorWidget)
|
PythonEditor::PythonEditor(PythonEditorWidget *editorWidget)
|
||||||
:BaseTextEditor(editorWidget)
|
:BaseTextEditor(editorWidget)
|
||||||
{
|
{
|
||||||
setContext(Core::Context(Constants::C_PYTHONEDITOR_ID,
|
setContext(Core::Context(Constants::C_PYTHONEDITOR_ID,
|
||||||
@@ -58,7 +58,7 @@ PythonEditor::PythonEditor(EditorWidget *editorWidget)
|
|||||||
|
|
||||||
Core::IEditor *PythonEditor::duplicate()
|
Core::IEditor *PythonEditor::duplicate()
|
||||||
{
|
{
|
||||||
EditorWidget *widget = new EditorWidget(qobject_cast<EditorWidget *>(editorWidget()));
|
PythonEditorWidget *widget = new PythonEditorWidget(qobject_cast<PythonEditorWidget *>(editorWidget()));
|
||||||
TextEditor::TextEditorSettings::initializeEditor(widget);
|
TextEditor::TextEditorSettings::initializeEditor(widget);
|
||||||
return widget->editor();
|
return widget->editor();
|
||||||
}
|
}
|
||||||
|
@@ -35,14 +35,14 @@
|
|||||||
namespace PythonEditor {
|
namespace PythonEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class EditorWidget;
|
class PythonEditorWidget;
|
||||||
|
|
||||||
class PythonEditor : public TextEditor::BaseTextEditor
|
class PythonEditor : public TextEditor::BaseTextEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PythonEditor(EditorWidget *editorWidget);
|
explicit PythonEditor(PythonEditorWidget *editorWidget);
|
||||||
|
|
||||||
Core::IEditor *duplicate();
|
Core::IEditor *duplicate();
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ EditorFactory::EditorFactory(QObject *parent)
|
|||||||
|
|
||||||
Core::IEditor *EditorFactory::createEditor()
|
Core::IEditor *EditorFactory::createEditor()
|
||||||
{
|
{
|
||||||
EditorWidget *widget = new EditorWidget();
|
PythonEditorWidget *widget = new PythonEditorWidget();
|
||||||
TextEditor::TextEditorSettings::initializeEditor(widget);
|
TextEditor::TextEditorSettings::initializeEditor(widget);
|
||||||
|
|
||||||
return widget->editor();
|
return widget->editor();
|
||||||
|
@@ -37,7 +37,7 @@ namespace PythonEditor {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class EditorFactory;
|
class EditorFactory;
|
||||||
class EditorWidget;
|
class PythonEditorWidget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class PyEditor::Plugin implements ExtensionSystem::IPlugin
|
\class PyEditor::Plugin implements ExtensionSystem::IPlugin
|
||||||
|
@@ -48,7 +48,7 @@
|
|||||||
namespace PythonEditor {
|
namespace PythonEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
EditorWidget::EditorWidget(QWidget *parent)
|
PythonEditorWidget::PythonEditorWidget(QWidget *parent)
|
||||||
: TextEditor::BaseTextEditorWidget(parent)
|
: TextEditor::BaseTextEditorWidget(parent)
|
||||||
{
|
{
|
||||||
baseTextDocument()->setId(Constants::C_PYTHONEDITOR_ID);
|
baseTextDocument()->setId(Constants::C_PYTHONEDITOR_ID);
|
||||||
@@ -56,13 +56,13 @@ EditorWidget::EditorWidget(QWidget *parent)
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorWidget::EditorWidget(EditorWidget *other)
|
PythonEditorWidget::PythonEditorWidget(PythonEditorWidget *other)
|
||||||
: TextEditor::BaseTextEditorWidget(other)
|
: TextEditor::BaseTextEditorWidget(other)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorWidget::ctor()
|
void PythonEditorWidget::ctor()
|
||||||
{
|
{
|
||||||
setParenthesesMatchingEnabled(true);
|
setParenthesesMatchingEnabled(true);
|
||||||
setMarksVisible(true);
|
setMarksVisible(true);
|
||||||
@@ -71,7 +71,7 @@ void EditorWidget::ctor()
|
|||||||
new PythonHighlighter(baseTextDocument());
|
new PythonHighlighter(baseTextDocument());
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::BaseTextEditor *EditorWidget::createEditor()
|
TextEditor::BaseTextEditor *PythonEditorWidget::createEditor()
|
||||||
{
|
{
|
||||||
return new PythonEditor(this);
|
return new PythonEditor(this);
|
||||||
}
|
}
|
||||||
|
@@ -36,19 +36,19 @@
|
|||||||
namespace PythonEditor {
|
namespace PythonEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class EditorWidget : public TextEditor::BaseTextEditorWidget
|
class PythonEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EditorWidget(QWidget *parent = 0);
|
PythonEditorWidget(QWidget *parent = 0);
|
||||||
EditorWidget(EditorWidget *other);
|
PythonEditorWidget(PythonEditorWidget *other);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TextEditor::BaseTextEditor *createEditor();
|
TextEditor::BaseTextEditor *createEditor();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
PythonEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||||
void ctor();
|
void ctor();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user