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

Julien Finet julien.finet at kitware.com
Fri Jun 14 12:00:52 UTC 2013


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/747c9020/attachment.htm>


More information about the Ctk-developers mailing list