Why scrollContentsBy(dx, dy) function not called when scroll by moving the cursor in QPlainTextEdit

561 views Asked by At

I have derived the QPlaintTextEdit and override the scrollContentsBy function. This gets called only when we use mouse-wheel or scrollbar. When we use arrow-keys to move the cursor and scroll content by that, this function does not get called.

I have done the same thing for QTextEdit, it works fine (means, it get called in all situations).

What is the reason for this behavior? and what is the alternative I can use?

NOTE: This is the function prototype

void QPlainTextEdit::scrollContentsBy ( int dx, int dy ) [virtual protected]

Environment:

  • Windows 7
  • Qt 4.8
  • VS 2008

Update: None of the following alternatives are working,

  • valueChanged
  • sliderMoved
0

There are 0 answers