Looks good, except that when populating the values vector (ctkMatrixWidget::values()), I would call ctkMatrixWidget::value(i,j) instead of manually querying the data in order to factorize code.<div><br></div><div>Thanks,</div>

<div>Julien.</div><div>p.s.I agree that setValues() would also beneficiate from some refactorization as well, but it's another story...<br><div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Aug 17, 2011 at 4:15 PM, Daniel Haehn <span dir="ltr"><<a href="mailto:haehn@bwh.harvard.edu">haehn@bwh.harvard.edu</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>
could you please review<br>
<br>
<a href="https://github.com/haehn/CTK/tree/add-SetValuesQPropertyMatrixWidget-feature" target="_blank">https://github.com/haehn/CTK/tree/add-SetValuesQPropertyMatrixWidget-feature</a><br>
<br>
Thx,<br>
<font color="#888888">Daniel<br>
</font><div><div></div><div class="h5"><br>
On Tue, Aug 16, 2011 at 3:57 PM, Jean-Christophe Fillion-Robin<br>
<<a href="mailto:jchris.fillionr@kitware.com">jchris.fillionr@kitware.com</a>> wrote:<br>
> +1 for setValues<br>
> Jc<br>
><br>
> On Tue, Aug 16, 2011 at 3:11 PM, Julien Finet <<a href="mailto:julien.finet@kitware.com">julien.finet@kitware.com</a>><br>
> wrote:<br>
>><br>
>> Because a "Q_PROPERTY adds features through the meta-object system".<br>
>> Practically in this case, it allows the property to be wrapped with<br>
>> python, and initial values can also be set directly via the Designer.<br>
>> As a more philosophical point, the matrix "values" are a "property" of the<br>
>> matrix.<br>
>> Julien.<br>
>> On Tue, Aug 16, 2011 at 3:04 PM, Daniel Haehn <<a href="mailto:haehn@bwh.harvard.edu">haehn@bwh.harvard.edu</a>><br>
>> wrote:<br>
>>><br>
>>> Hi Julien,<br>
>>><br>
>>> why do you think a Q_PROPERTY is better? Anyway, I will give it a shot<br>
>>> and let you know.<br>
>>><br>
>>> Cheers,<br>
>>> Daniel<br>
>>><br>
>>> On Tue, Aug 16, 2011 at 1:48 PM, Julien Finet <<a href="mailto:julien.finet@kitware.com">julien.finet@kitware.com</a>><br>
>>> wrote:<br>
>>> > Either that or we make a Q_PROPERTY named "values":<br>
>>> > Q_PROPERTY( QVector<double> values READ values WRITE setValues)<br>
>>> > There is already: ctkMatrixWidget::setVector(QVector<double>), maybe it<br>
>>> > could be renamed into setValues and values() should then also be<br>
>>> > written.<br>
>>> > Julien.<br>
>>> ><br>
>>> > On Tue, Aug 16, 2011 at 12:37 PM, Daniel Haehn <<a href="mailto:haehn@bwh.harvard.edu">haehn@bwh.harvard.edu</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> Hi guys,<br>
>>> >><br>
>>> >> it seems that it is not possible to set a value of a ctkMatrixWidget<br>
>>> >> from Python?<br>
>>> >><br>
>>> >> Shall we just enable Q_INVOKABLE on the ctkMatrixWidget::setValue<br>
>>> >> method?<br>
>>> >><br>
>>> >> Thanks,<br>
>>> >> Daniel<br>
>>> >> _______________________________________________<br>
>>> >> Ctk-developers mailing list<br>
>>> >> <a href="mailto:Ctk-developers@commontk.org">Ctk-developers@commontk.org</a><br>
>>> >> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
>>> ><br>
>>> ><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Ctk-developers mailing list<br>
>> <a href="mailto:Ctk-developers@commontk.org">Ctk-developers@commontk.org</a><br>
>> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> <a href="tel:%2B1%20919%20869%208849" value="+19198698849">+1 919 869 8849</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>