Quote Originally Posted by Spitfire View Post
1 - This QTextBrowser does it by default when text is appended. When text is inserted it doesn't but it requires very little work:
Qt Code:
  1. MyBrowser::MyBrowser( QWidget* parent ) :
  2. QTextBrowser( parent ),
  3. atBottom( false )
  4. {
  5. connect( this, SIGNAL( textChanged() ), this, SLOT( scrollToBottom() ) );
  6. connect( this->verticalScrollBar(), SIGNAL( valueChanged( int ) ), this, SLOT( scrolledTo( int ) ) );
  7. }
  8.  
  9. void MyBrowser::scrollToBottom( void )
  10. {
  11. if( this->atBottom )
  12. {
  13. this->verticalScrollBar()->setValue( this->verticalScrollBar()->maximum() );
  14. }
  15. }
  16.  
  17. void MyBrowser::scrolledTo( int val )
  18. {
  19. this->atBottom = val == this->verticalScrollBar()->maximum();
  20. }
To copy to clipboard, switch view to plain text mode 
First of all, I'm inserting text using a QTextCursor, not the QTextBrowser's append method. Second, it should only auto-scroll if it was already at the bottom before text was inserted.

Quote Originally Posted by Spitfire View Post
2 - I don't quite get your question. The browser doesn't scroll anywhere when you resize it, just show more/less text.
When I make it smaller horizontally, it scrolls up, and when I make it bigger horizontally, it scrolls down.