forked from qt-creator/qt-creator
Line locator: Also work with editors that are derived from IEditor
IEditor has a concept of line and column number and goto line, thus this can be done. Change-Id: Ic2e3bdcfa2b1debf102afc21bfe9be667a0264c8 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <QActionGroup>
|
||||
#include <QToolBar>
|
||||
#include <QTextBlock>
|
||||
|
||||
using namespace Android;
|
||||
using namespace Internal;
|
||||
@@ -93,6 +94,17 @@ TextEditor::BaseTextEditorWidget *AndroidManifestEditor::textEditor() const
|
||||
return widget()->textEditorWidget();
|
||||
}
|
||||
|
||||
int AndroidManifestEditor::currentLine() const
|
||||
{
|
||||
return textEditor()->textCursor().blockNumber() + 1;
|
||||
}
|
||||
|
||||
int AndroidManifestEditor::currentColumn() const
|
||||
{
|
||||
QTextCursor cursor = textEditor()->textCursor();
|
||||
return cursor.position() - cursor.block().position() + 1;
|
||||
}
|
||||
|
||||
void AndroidManifestEditor::changeEditorPage(QAction *action)
|
||||
{
|
||||
if (!widget()->setActivePage(static_cast<AndroidManifestEditorWidget::EditorPage>(action->data().toInt()))) {
|
||||
|
||||
Reference in New Issue
Block a user