[Ctk-developers] ctkRangeSlider, ctkDoubleRangeSlider and others inherited QAbstractSlider with a negative minimum value

Julien Finet julien.finet at kitware.com
Thu Oct 7 02:11:45 UTC 2010


Hi Wagner,

Thanks for your feedback. The behavior you encounter with ctkRangeSlider is
normal, it is the exact same behavior than QSlider (or QxtSpanSlider): you
can't set the value of an handle before making sure that it will be inside
the slider bounds (setMinimum/setMaximum).
Qt Designer solves the issue by following the order of the properties in the
header of a C++ class.
To have a correct behavior when using Qt Designer, the "Minimum" and
"Maximum" properties (Q_PROPERTY) are defined before the
"MinimumValue"/"MaximumValue" properties.

I wouldn't change anything in the code. The behavior seems fine to me. I
would prefer adding a warning in the comments.

Feel free to submit a patch with more documentation. Otherwise, I'll do it.

Thanks,
Julien.

On Wed, Oct 6, 2010 at 6:32 PM, Ron Kikinis <kikinis at bwh.harvard.edu> wrote:

> good catch relative to Hounsfield units.
>
>
> On 10/6/2010 10:47 AM, Wagner Sales wrote:
>
>> Hi all,
>>
>> After taking a look for a couple of minutes in range sliders which
>> inherits from QAbstractSlider I see a ( i think ) problem: you cannot
>> start setting the minimum value as a negative value. Instead, you'll
>> needs to set minimum by QAbstractSlider::setMinimum(negative value)
>> and after ctkRangeSlider::setMinimumValue(negative value). Only to
>> point: this occurs in QxtSpanSlider too ( of course not the topic here
>> )!. What can be done about this? Change the behavior? Document in the
>> class? A warning in the method? Well, since I spent some time to found
>> this, I think others don't need to spent too. ;)
>>
>> Best Regards,
>>
>> Wagner Sales
>> _______________________________________________
>> Ctk-developers mailing list
>> Ctk-developers at commontk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>>
>
>
> --
> Ron Kikinis, M.D.,
> Robert Greenes Distinguished Director of Biomedical Informatics
> Professor of Radiology, Harvard Medical School
> Director, Surgical Planning Laboratory
> http://www.spl.harvard.edu/~kikinis
>
> _______________________________________________
> Ctk-developers mailing list
> Ctk-developers at commontk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20101007/2fffbab4/attachment.htm>


More information about the Ctk-developers mailing list