forked from qt-creator/qt-creator
TextEditor: Rename BaseTextEditorWidget to TextEditorWidget
... and some of the related implementation details Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -70,7 +70,7 @@ namespace DiffEditor {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class DescriptionEditorWidget : public BaseTextEditorWidget
|
||||
class DescriptionEditorWidget : public TextEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
};
|
||||
|
||||
DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent)
|
||||
: BaseTextEditorWidget(parent)
|
||||
: TextEditorWidget(parent)
|
||||
{
|
||||
setupFallBackEditor("DiffEditor.DescriptionEditor");
|
||||
|
||||
@@ -107,7 +107,7 @@ DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent)
|
||||
settings.m_displayFoldingMarkers = false;
|
||||
settings.m_markTextChanges = false;
|
||||
settings.m_highlightBlocks = false;
|
||||
BaseTextEditorWidget::setDisplaySettings(settings);
|
||||
TextEditorWidget::setDisplaySettings(settings);
|
||||
|
||||
setCodeFoldingSupported(true);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
@@ -117,7 +117,7 @@ DescriptionEditorWidget::DescriptionEditorWidget(QWidget *parent)
|
||||
|
||||
QSize DescriptionEditorWidget::sizeHint() const
|
||||
{
|
||||
QSize size = BaseTextEditorWidget::sizeHint();
|
||||
QSize size = TextEditorWidget::sizeHint();
|
||||
size.setHeight(size.height() / 5);
|
||||
return size;
|
||||
}
|
||||
@@ -126,19 +126,19 @@ void DescriptionEditorWidget::setDisplaySettings(const DisplaySettings &ds)
|
||||
{
|
||||
DisplaySettings settings = displaySettings();
|
||||
settings.m_visualizeWhitespace = ds.m_visualizeWhitespace;
|
||||
BaseTextEditorWidget::setDisplaySettings(settings);
|
||||
TextEditorWidget::setDisplaySettings(settings);
|
||||
}
|
||||
|
||||
void DescriptionEditorWidget::setMarginSettings(const MarginSettings &ms)
|
||||
{
|
||||
Q_UNUSED(ms);
|
||||
BaseTextEditorWidget::setMarginSettings(MarginSettings());
|
||||
TextEditorWidget::setMarginSettings(MarginSettings());
|
||||
}
|
||||
|
||||
void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->buttons()) {
|
||||
BaseTextEditorWidget::mouseMoveEvent(e);
|
||||
TextEditorWidget::mouseMoveEvent(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ void DescriptionEditorWidget::mouseMoveEvent(QMouseEvent *e)
|
||||
cursorShape = Qt::IBeamCursor;
|
||||
}
|
||||
|
||||
BaseTextEditorWidget::mouseMoveEvent(e);
|
||||
TextEditorWidget::mouseMoveEvent(e);
|
||||
viewport()->setCursor(cursorShape);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ void DescriptionEditorWidget::mouseReleaseEvent(QMouseEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
BaseTextEditorWidget::mouseReleaseEvent(e);
|
||||
TextEditorWidget::mouseReleaseEvent(e);
|
||||
}
|
||||
|
||||
bool DescriptionEditorWidget::findContentsUnderCursor(const QTextCursor &cursor)
|
||||
@@ -183,7 +183,7 @@ void DescriptionEditorWidget::highlightCurrentContents()
|
||||
sel.cursor = m_currentCursor;
|
||||
sel.cursor.select(QTextCursor::LineUnderCursor);
|
||||
sel.format.setFontUnderline(true);
|
||||
setExtraSelections(BaseTextEditorWidget::OtherSelection,
|
||||
setExtraSelections(TextEditorWidget::OtherSelection,
|
||||
QList<QTextEdit::ExtraSelection>() << sel);
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class QToolButton;
|
||||
class QStackedWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace TextEditor { class BaseTextEditorWidget; }
|
||||
namespace TextEditor { class TextEditorWidget; }
|
||||
|
||||
namespace DiffEditor {
|
||||
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
void writeCurrentDiffEditorSetting(QWidget *currentEditor);
|
||||
|
||||
QSharedPointer<DiffEditorDocument> m_document;
|
||||
TextEditor::BaseTextEditorWidget *m_descriptionWidget;
|
||||
TextEditor::TextEditorWidget *m_descriptionWidget;
|
||||
QStackedWidget *m_stackedWidget;
|
||||
SideBySideDiffEditorWidget *m_sideBySideEditor;
|
||||
UnifiedDiffEditorWidget *m_unifiedEditor;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
namespace DiffEditor {
|
||||
|
||||
SelectableTextEditorWidget::SelectableTextEditorWidget(Core::Id id, QWidget *parent)
|
||||
: BaseTextEditorWidget(parent)
|
||||
: TextEditorWidget(parent)
|
||||
{
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setupFallBackEditor(id);
|
||||
@@ -153,8 +153,7 @@ void SelectableTextEditorWidget::paintBlock(QPainter *painter,
|
||||
}
|
||||
newSelections += selections;
|
||||
|
||||
BaseTextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect);
|
||||
|
||||
TextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect);
|
||||
}
|
||||
|
||||
} // namespace DiffEditor
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
};
|
||||
|
||||
class DIFFEDITOR_EXPORT SelectableTextEditorWidget
|
||||
: public TextEditor::BaseTextEditorWidget
|
||||
: public TextEditor::TextEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
void clearAll(const QString &message);
|
||||
void clearAllData();
|
||||
QTextBlock firstVisibleBlock() const {
|
||||
return BaseTextEditorWidget::firstVisibleBlock();
|
||||
return TextEditorWidget::firstVisibleBlock();
|
||||
}
|
||||
// void setDocuments(const QList<QPair<DiffFileInfo, QString> > &documents);
|
||||
|
||||
@@ -294,7 +294,7 @@ SideDiffEditorWidget::SideDiffEditorWidget(QWidget *parent)
|
||||
settings.m_highlightBlocks = false;
|
||||
SelectableTextEditorWidget::setDisplaySettings(settings);
|
||||
|
||||
connect(this, &BaseTextEditorWidget::tooltipRequested, [this](const QPoint &point, int position) {
|
||||
connect(this, &TextEditorWidget::tooltipRequested, [this](const QPoint &point, int position) {
|
||||
int block = document()->findBlock(position).blockNumber();
|
||||
auto it = m_fileInfo.constFind(block);
|
||||
if (it != m_fileInfo.constEnd())
|
||||
@@ -479,7 +479,7 @@ void SideDiffEditorWidget::clearAll(const QString &message)
|
||||
setBlockSelection(false);
|
||||
clear();
|
||||
clearAllData();
|
||||
setExtraSelections(BaseTextEditorWidget::OtherSelection,
|
||||
setExtraSelections(TextEditorWidget::OtherSelection,
|
||||
QList<QTextEdit::ExtraSelection>());
|
||||
setPlainText(message);
|
||||
// m_highlighter->setDocuments(QList<QPair<DiffFileInfo, QString> >());
|
||||
|
||||
Reference in New Issue
Block a user