Results 1 to 7 of 7

Thread: QwtSlider with zero range

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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 with zero range

    Thought you want to nail a fixed value - why do you have to narrow the borders for this ?
    But anyway: a slider with an empty range doesn't make any sense as you don't have a slider position then.

    Uwe

  2. #2
    Join Date
    Apr 2014
    Posts
    13
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtSlider with zero range

    Ok, to give a more complete explanation: our machines are able to pulse some light with a frequency. The frequency can be adjusted by the user in a specific range, set by our service personal. There are some machines which should pulse only on a single frequency, so our service is used to set upper border and lower border to the same value.

    Anyway, I had the same use case with Qwt5.2.1, and it worked there (setting upper border and lower border to let's say 50 and slider->value() gives me 50). The behaviour in Qwt6.1.2 is different, slider->value() gives me 0. The range is not empty (may depend on the definition of empty of course), and I think there is a position for the thumb - 50. Even if the thumb cannot move.

    Hopefully this explains my problem better. Sorry for the confusion!

    Thanks,
    Carsten

  3. #3
    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 with zero range

    Each position of a slider corresponds to a value, and each value to a position - otherwise it doesn't work. So what should happen when all positions of the slider correspond to 50 - where to draw the handle ?
    But why not simply setting some valid range and putting the slider into read only mode, when the user sets an empty range ?

    Uwe

  4. #4
    Join Date
    Apr 2014
    Posts
    13
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtSlider with zero range

    I implemented it as you suggested, it works fine.
    Thanks for your help,
    Carsten

Similar Threads

  1. Customizing Qwtslider
    By Navi in forum Qwt
    Replies: 2
    Last Post: 24th June 2015, 08:08
  2. Customizing Qwtslider
    By Navi in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2015, 15:34
  3. scale in QwtSlider and QwtPlot
    By mastupristi in forum Qwt
    Replies: 3
    Last Post: 20th October 2014, 07:37
  4. QwtSlider stepSize
    By snowbound in forum Qwt
    Replies: 5
    Last Post: 14th March 2014, 13:46
  5. QwtSlider resize
    By vratojr in forum Qwt
    Replies: 1
    Last Post: 13th July 2011, 12:28

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.