Results 1 to 2 of 2

Thread: setting scrollbar limits

  1. #1
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default setting scrollbar limits

    hi,

    i have a custom drawn widget, that has a horizontal scrollbar. Here
    http://doc-snapshot.qt-project.org/4.8/qscrollbar.html
    is a very nice description how to choose min/max values, but because i am incompetent, i can get it to work.

    I have these values:

    x = total number of rows
    y = exposed number of rows

    and need these:

    min, max, singelstep, pagestep


    I would say three of them are clear:

    min = 0
    singlestep = 1
    pagestep = y


    choosing a max value is the challenge here.


    if we just do

    max = x

    then that works OK, but if we scroll down all the way, the screen will be "empty", because the last line to display is above the visible area.
    First thing that comes to mind is doing max = x-y. Then only half the screen is empty when we scroll full down. Not sure why, though.




    This shouldnt be too hard, but my brain got stuck somewhere.
    any help i appreciated.
    Last edited by tuli; 6th September 2012 at 13:24.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setting scrollbar limits

    One option is:

    min = 0
    singlestep = height of row
    pagestep = number of visible rows * height of row
    max = number of rows * height of row - pagestep
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QFile::handle count limits
    By evgenM in forum Qt Programming
    Replies: 0
    Last Post: 14th January 2010, 08:22
  2. limits for drawing a QwtPlotCurve
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 1st December 2009, 10:02
  3. Hitting memory limits for malloc() at about 1.7GB?
    By Skywalker in forum Qt Programming
    Replies: 7
    Last Post: 8th July 2009, 02:44
  4. QStandardItemModel limits
    By baray98 in forum Qt Programming
    Replies: 3
    Last Post: 7th April 2008, 09:51

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.