summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-09-13 13:52:50 +0200
committerhjk <qtc-committer@nokia.com>2010-09-14 17:18:44 +0200
commitfb05c7a9e2fa4f659df6f816cb89f52ed30ea7fc (patch)
tree12e506f5c8b02e89f1cd4c50a738546f3a6c03fe
parent26417ff48ee5d7e930b0278eefd505298d33d1c6 (diff)
downloadqt-creator-fb05c7a9e2fa4f659df6f816cb89f52ed30ea7fc.tar.gz
basetexteditor: make block selection accessible
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp15
-rw-r--r--src/plugins/texteditor/basetexteditor.h2
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;