[Ctk-developers] ctkSliderWidget, ctkDoubleSlider and ctkDoubleSpinBox invertedControls property

Miklos Espak espakm at gmail.com
Fri Jun 14 09:12:32 EDT 2013


Hi Julien,

I rebased my fix on a recent commit (not the latest) that has this
ctkSpinBox, and squashed its commits to a single one, and resent the pull
request.

This still conflicts with the CTK master (the ctkSliderWidget uses
ctkDoubleSpinBox and not ctkSpinBox), but hopefully this will make the
integration easier.

https://github.com/NifTK/CTK/commits/slider-inverted-properties

The renaming in itself won't be enough. If the spinbox class must be a
QWidget then we will probably need a new private class that derives from
QDoubleBox.

Thanks,
Miklos


On Fri, Jun 14, 2013 at 1:00 PM, Julien Finet <julien.finet at kitware.com>wrote:

> Hi Miklos,
>
> The plan is to:
>  a) rename ctkSpinBox into ctkDoubleSpinBox
>  b) integrate your changes into freshly renamed ctkDoubleSpinBox
>
> I just haven't had the time to do the renaming yet.
>
> The reasons behind having ctkSpinBox deriving from QWidget are:
>  a) some QDoubleSpinBox methods are not virtual and can't be reimplemented
>  b) it can give greater flexibility if we want to "add" helper widgets in
> the future
>  c) it prevents the user from calling QDoubleSpinBox methods directly (it
> is still possible though)
>
> Hth,
> Julien.
>
>
> On Fri, Jun 14, 2013 at 7:35 AM, Miklos Espak <espakm at gmail.com> wrote:
>
>> Hi guys,
>>
>> what should we do with this?
>>
>> The current status is that there are two different spin box
>> implementations.
>>
>> My one is ctkDoubleSpinBox that derives from QDoubleSpinBox and adds the
>> invertedControls properties. It's on a branch in our fork.
>>
>> The other is ctkSpinBox that derives from QWidget.
>>
>> My fix overrides QAbstractSpinBox::stepBy, so it cannot be merged to
>> ctkSpinBox as it is. The ctkSpinBox does not have a stepBy function,
>> although it's part of the public API of QAbstractSpinBox.
>>
>> I can change ctkSpinBox to use ctkDoubleSpinBox instead of
>> QDoubleSpinBox, and introduce the invertedControls property in ctkSpinBox
>> by delegation.
>>
>> But in this way, we would have two spin box classes. (My one could be
>> internal only, but still.)
>>
>> Is there a specific reason why the ctkSpinBox derives from QWidget and
>> not QDoubleSpinBox? The API of the current implementation is not compatible
>> with the QAbstractSpinBox API what I think, is a problem.
>>
>> Cheers,
>> Miklos
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20130614/b7e726b9/attachment.html>


More information about the Ctk-developers mailing list