Because it's quite old project I don't have any choice and have to use Qt 3.3.3/Embedded. I have to display a file. As the display fills up, a vertical scrollbar is displayed. Problem is control that scrollbar now it dosen't work as I want. I press keyUp or keyDown, scrollbar goes up, reaches top and then with every next press scrollbar decreases.

Part of constructor:
Qt Code:
  1. textEdit = new QTextEdit(this);
  2. textEdit->setGeometry(1,2, 639,425);
  3. textEdit->setPaper(Qt::black);
  4. textEdit->setColor(Qt::white);
To copy to clipboard, switch view to plain text mode 

Part of readFile function:
Qt Code:
  1. QFile fp("errors.txt");
  2. char buff[255];
  3. fp.open(IO_ReadOnly);
  4. textEdit->setCurrentFont(font);
  5. while (!fp.atEnd() ) {
  6. fp.readLine(buff, sizeof(buff));
  7. textEdit->append(buff);
  8. }
  9. fp.close();
To copy to clipboard, switch view to plain text mode 

Part of handling device's keyboard:
Qt Code:
  1. bool keyHandled = false;
  2. switch (event->key()) {
  3. case Key_Up:
  4. keyHandled = true;
  5. textEdit->moveCursor(QTextEdit::MoveUp, 0);
  6. update();
  7. break;
  8.  
  9. case Key_Down:
  10. keyHandled = true;
  11. textEdit->moveCursor(QTextEdit::MoveDown, 0);
  12. update();
  13. break;
  14.  
  15. default:
  16. keyHandled = false;
  17. break;
  18. }
  19. return keyHandled;
To copy to clipboard, switch view to plain text mode