Check scroll being scrolled



  • hello guys,

    i have a qtextbrowser in my app and i want to check if the scroll is scrolled down to the end of the page. Something similar to agreement reading.

    Could somebody please point me to the right direction, how to do it.

    thanks


  • Moderators

    You an do the following:
    @
    connect(myTextBrowser->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(onVerticalScrollBarValueChanged()));
    ....
    void MyTextBrowser::onVerticalScrollBarValueChanged()
    {
    if( myTextBrowser->verticalScrollBar()->value() == myTextBrowser->horizontalScrollBar()->maximum() )
    {
    .... //do your stuff here
    }
    }
    @



  • the slot must have an int parameter for example:

    @
    void MyTextBrowser::onVerticalScrollBarValueChanged(int a) {
    if(myTB->verticalScrollBar()->maximum() == a) { //bla bla }

    }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.