Hi Julien,<br><br>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.<br><br>This still conflicts with the CTK master (the ctkSliderWidget uses ctkDoubleSpinBox and not ctkSpinBox), but hopefully this will make the integration easier.<br>
<br><a href="https://github.com/NifTK/CTK/commits/slider-inverted-properties">https://github.com/NifTK/CTK/commits/slider-inverted-properties</a><br><br>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.<br>
<br>Thanks,<br>Miklos<br><br><br><div class="gmail_quote">
On Fri, Jun 14, 2013 at 1:00 PM, Julien Finet <span dir="ltr"><<a href="mailto:julien.finet@kitware.com" target="_blank">julien.finet@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Miklos,<div><br></div><div>The plan is to:</div><div> a) rename ctkSpinBox into ctkDoubleSpinBox</div><div> b) integrate your changes into freshly renamed ctkDoubleSpinBox</div><div><br>
</div><div>I just haven't had the time to do the renaming yet.</div><div><br></div><div>The reasons behind having ctkSpinBox deriving from QWidget are:</div><div> a) some QDoubleSpinBox methods are not virtual and can't be reimplemented</div>
<div> b) it can give greater flexibility if we want to "add" helper widgets in the future</div><div> c) it prevents the user from calling QDoubleSpinBox methods directly (it is still possible though)</div>
<div><br></div><div>Hth,</div><div>Julien.</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 14, 2013 at 7:35 AM, Miklos Espak <span dir="ltr"><<a href="mailto:espakm@gmail.com" target="_blank">espakm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi guys,<br><br>what should we do with this?<br><br>The current status is that there are two different spin box implementations.<br>
<br>My one is ctkDoubleSpinBox that derives from QDoubleSpinBox and adds the invertedControls properties. It's on a branch in our fork.<br>
<br>The other is ctkSpinBox that derives from QWidget.<br><br>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.<br>
<br>I can change ctkSpinBox to use ctkDoubleSpinBox instead of QDoubleSpinBox, and introduce the invertedControls property in ctkSpinBox by delegation.<br><br>But in this way, we would have two spin box classes. (My one could be internal only, but still.)<br>
<br>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.<br><br>Cheers,<br>
Miklos<br><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br>