diff options
author | hjk <[email protected]> | 2014-08-27 11:57:32 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2014-08-27 15:00:36 +0200 |
commit | 2a5c602341dd07b146d755f3674fbfc054bce48a (patch) | |
tree | c4ef0044a8d52e0fd942ab0e79a31e9c182b8f4d /src/plugins/debugger/debuggerplugin.cpp | |
parent | d2c243464ece44b27e8a03c73b45d9de424adcd8 (diff) |
TextEditor: Introduce some convenience text accessors in the editor
And adjust users.
Change-Id: I9329257cfa5f3298731deb07c2881bc37d9a051d
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 17c538996bd..36600aff11c 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1030,9 +1030,7 @@ public slots: { BaseTextEditor *textEditor = BaseTextEditor::currentTextEditor(); QTC_ASSERT(textEditor, return); - QPlainTextEdit *ed = textEditor->editorWidget(); - QTC_ASSERT(ed, return); - QTextCursor cursor = ed->textCursor(); + QTextCursor cursor = textEditor->textCursor(); QString functionName = cursor.selectedText(); if (functionName.isEmpty()) { const QTextBlock block = cursor.block(); @@ -1098,11 +1096,10 @@ public slots: void handleAddToWatchWindow() { // Requires a selection, but that's the only case we want anyway. - IEditor *editor = EditorManager::currentEditor(); - BaseTextEditor *textEditor = qobject_cast<BaseTextEditor*>(editor); + BaseTextEditor *textEditor = BaseTextEditor::currentTextEditor(); if (!textEditor) return; - QTextCursor tc = textEditor->editorWidget()->textCursor(); + QTextCursor tc = textEditor->textCursor(); QString exp; if (tc.hasSelection()) { exp = tc.selectedText(); |