forked from qt-creator/qt-creator
TextEditor: Shuffle some convenience functions
Remove rarely used ones, add a currentTextEditorWidget() Change-Id: I27b97c17927c71e07dc3b489785b7f2f76eb801e Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -1018,6 +1018,12 @@ TextDocumentPtr TextEditorWidget::textDocumentPtr() const
|
||||
return d->m_document;
|
||||
}
|
||||
|
||||
TextEditorWidget *TextEditorWidget::currentTextEditorWidget()
|
||||
{
|
||||
BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(EditorManager::currentEditor());
|
||||
return editor ? editor->editorWidget() : 0;
|
||||
}
|
||||
|
||||
void TextEditorWidgetPrivate::editorContentsChange(int position, int charsRemoved, int charsAdded)
|
||||
{
|
||||
if (m_animator)
|
||||
@@ -6702,11 +6708,6 @@ void BaseTextEditor::convertPosition(int pos, int *line, int *column) const
|
||||
editorWidget()->convertPosition(pos, line, column);
|
||||
}
|
||||
|
||||
QRect BaseTextEditor::cursorRect(int pos) const
|
||||
{
|
||||
return editorWidget()->cursorRect(pos);
|
||||
}
|
||||
|
||||
QString BaseTextEditor::selectedText() const
|
||||
{
|
||||
return editorWidget()->selectedText();
|
||||
@@ -7124,11 +7125,6 @@ TextEditorWidget *BaseTextEditor::editorWidget() const
|
||||
return static_cast<TextEditorWidget *>(m_widget.data());
|
||||
}
|
||||
|
||||
QTextDocument *BaseTextEditor::qdocument() const
|
||||
{
|
||||
return textDocument()->document();
|
||||
}
|
||||
|
||||
void BaseTextEditor::setTextCursor(const QTextCursor &cursor)
|
||||
{
|
||||
editorWidget()->setTextCursor(cursor);
|
||||
|
||||
Reference in New Issue
Block a user