Results 1 to 6 of 6

Thread: QwtSlider stepSize

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2012
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtSlider stepSize

    What I'm trying to achieve in 6.1 is the lower right horizontal slider in the example project from 6.0. The one that goes from 1000 to 3000, has major labels every 500 and the slider step size is 10.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtSlider stepSize

    Scale and step sizes have been decoupled because of non linear ( f.e. logarithmic ) scales - what is a new feature of Qwt 6.1

    For controlling the major ticks see: QwtAbstractScale::setScaleMaxMajor( int ), but the default setting of 8 should be o.k. Remove all what you tried so far and simply do a "slider->setScale( 1000, 3000);"
    For controlling the number of steps have a look at the methods in QwtAbstractSlider. In case of a linear scale you can calculate the number of steps easily this way: numSteps = ( max - min ) / stepSize;

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    snowbound (14th March 2014)

Similar Threads

  1. Replies: 3
    Last Post: 15th January 2014, 07:52
  2. Customize tick labels in a QwtSlider
    By RomanRdgz in forum Qwt
    Replies: 16
    Last Post: 10th September 2012, 13:02
  3. QwtSlider resize
    By vratojr in forum Qwt
    Replies: 1
    Last Post: 13th July 2011, 12:28
  4. Align QwtSlider and QwtPlot
    By justoit in forum Qwt
    Replies: 4
    Last Post: 4th May 2011, 11:41
  5. Setting Initial QwtSlider Position
    By Mannion in forum Qwt
    Replies: 4
    Last Post: 3rd May 2011, 21:24

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
  •  
Qt is a trademark of The Qt Company.