diff options
author | hjk <qtc-committer@nokia.com> | 2010-09-13 13:52:50 +0200 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2010-09-14 17:18:44 +0200 |
commit | fb05c7a9e2fa4f659df6f816cb89f52ed30ea7fc (patch) | |
tree | 12e506f5c8b02e89f1cd4c50a738546f3a6c03fe | |
parent | 26417ff48ee5d7e930b0278eefd505298d33d1c6 (diff) | |
download | qt-creator-fb05c7a9e2fa4f659df6f816cb89f52ed30ea7fc.tar.gz |
basetexteditor: make block selection accessible
-rw-r--r-- | src/plugins/texteditor/basetexteditor.cpp | 15 | ||||
-rw-r--r-- | src/plugins/texteditor/basetexteditor.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 53ffdea928..87062a84b5 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -5786,6 +5786,21 @@ bool BaseTextEditor::inFindScope(int selectionStart, int selectionEnd) return true; } +void BaseTextEditor::setBlockSelection(bool on) +{ + if (d->m_inBlockSelectionMode != on) { + d->m_inBlockSelectionMode = on; + if (on) + d->m_blockSelection.fromSelection(tabSettings(), textCursor()); + viewport()->update(); + } +} + +bool BaseTextEditor::hasBlockSelection() const +{ + return d->m_inBlockSelectionMode; +} + void BaseTextEditor::handleBlockSelection(int diff_row, int diff_col) { diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 176350502f..423dff62ae 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -237,6 +237,8 @@ public: void insertCodeSnippet(const QTextCursor &cursor, const QString &snippet); + void setBlockSelection(bool on); + bool hasBlockSelection() const; int verticalBlockSelectionFirstColumn() const; int verticalBlockSelectionLastColumn() const; |