Need help with scrollarea scrolling out of control
I have made a small program that will scroll an area but it wont scroll right, it WILL in fact scroll but it keeps on scrolling no matter what i do, i can slide the vertical scroll bar back upwards and it will continue to scroll the contents of my box until i cant see them anymore.
here is code
Code:
void MainWindow::on_verticalScrollBar_sliderMoved(int position)
{
ui->verticalScrollBar->setRange(0, 1000);
ui->scrollArea->scroll(0, 1);
}
can anyone tell me how to stop the scrolling at a point and then scroll back upwards.
Re: Need help with scrollarea scrolling out of control
You are telling Qt to scroll down 1 pixel no matter which direction the scroll bar is being moved. Perhaps you should consider setting the range once, then testing position against its bounds and scrolling accordingly.
Re: Need help with scrollarea scrolling out of control
how would i go about doing that? I don't understand how to test it against its bounds. Sorry but im VERY new to all this, just started about 3 days ago.