From 9694dcffd1de669f808cbf6563862d4949ab4c73 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Thu, 10 May 2012 12:32:41 +0200 Subject: [PATCH] QmlProfiler: adapt binding location at call to gotoLine Change-Id: Iceff7120a5e88181e5aad452d3f0f90b3215ce1d Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qmlprofilertool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 575cb8cbe59..0e871545d82 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -497,7 +497,9 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber, if (textEditor) { editorManager->addCurrentPositionToNavigationHistory(); - textEditor->gotoLine(lineNumber, columnNumber); + // textEditor counts columns starting with 0, but the ASTs store the + // location starting with 1, therefore the -1 in the call to gotoLine + textEditor->gotoLine(lineNumber, columnNumber - 1); textEditor->widget()->setFocus(); } }