Results 1 to 3 of 3

Thread: Need help with scrollarea scrolling out of control

  1. #1
    Join Date
    Nov 2012
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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

    Qt Code:
    1. void MainWindow::on_verticalScrollBar_sliderMoved(int position)
    2. {
    3. ui->verticalScrollBar->setRange(0, 1000);
    4. ui->scrollArea->scroll(0, 1);
    5. }
    To copy to clipboard, switch view to plain text mode 

    can anyone tell me how to stop the scrolling at a point and then scroll back upwards.

  2. #2
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default 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.

  3. #3
    Join Date
    Nov 2012
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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.

Similar Threads

  1. scrollArea
    By skizzik in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2011, 12:55
  2. Replies: 0
    Last Post: 16th December 2009, 09:45
  3. ScrollArea:AutoScroll to setfocus'ed control
    By BalaQT in forum Qt Programming
    Replies: 4
    Last Post: 26th October 2009, 05:39
  4. Autoscroll in ScrollArea
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2009, 05:37
  5. scrollArea not updating
    By user in forum Qt Programming
    Replies: 9
    Last Post: 3rd October 2007, 08:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.