[Qt-creator] Not scroll editor when stepping in debugger

andre apoenitz at t-online.de
Sun Feb 23 13:34:19 CET 2014

On Sun, Feb 23, 2014 at 11:04:48AM +0100, Wiebe Cazemier wrote:
> Hi, 
> I've been working with Qt Creator (version 3 now) and Qt (5.1) for a few
> months, and I would like to extend my compliments :) However, I do have a
> question which is probably going to become a feature request. 
> When stepping in the debugger, the editor window centers on the current
> statement. I find this confusing. I'm used to Visual Studio, which only
> scrolls the editor when the next statement would be off-screen. The
> auto-centering editor of Qt Creator becomes especially confusing when
> debugging loops. My eye would have a much better time with visual
> tracking if the editor window would remain static. 
> I asked on the forum if whether it's possible to configure it like that
> [1], but the response was 'probably not, ask on the list' :) 
> So, is it possible, and if not, would this be a worthwhile configuration
> option? 

I am not aware of such an option, and of course it could be added, in
theory.  However, there's a soft limit on the numbers of options that
should be added to mimic behaviour of other IDEs. 

For a quick attempt you can replace the 'centerCursor()' call
with 'ensureCursorVisible();' in BaseTextEditorWidget::gotoLine
in src/plugins/tesxteditor/basetexteditor.cpp:1985.

And this definitely feels odd to me. It essentially removes a
significant part of the "visual execution context", by not showing
"what will be executed in the near future". At the very least,
the remaining context should be more than one line (I just checked,
Eclipse seems to use 8), but then it feels odd that in some cases
the line moves, and in some not.

OTOH, I might just be conditioned to the current behaviour.
A feature request would go to bugreports.qt-project.org.


More information about the Qt-creator mailing list