Maybe <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">QVector<double> needs to be entered in the meta object system.</span><div><font class="Apple-style-span" face="arial, sans-serif"><br>

</font></div><div><font class="Apple-style-span" face="arial, sans-serif">Can you try adding <br></font></div><span class="Apple-style-span" style="border-collapse: separate; font-family: Arial; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: medium; "><span class="Apple-style-span" style="color: rgb(54, 53, 52); font-family: Verdana; font-size: 13px; line-height: 15px; "><h3 class="fn" style="margin-top: 15px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; font-size: 16px; border-top-left-radius: 7px 7px; border-top-right-radius: 7px 7px; border-bottom-right-radius: 7px 7px; border-bottom-left-radius: 7px 7px; background-color: rgb(246, 246, 246); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(230, 230, 230); border-right-color: rgb(230, 230, 230); border-bottom-color: rgb(230, 230, 230); border-left-color: rgb(230, 230, 230); font-weight: bold; word-spacing: 3px; font: normal normal 600 16px/1.2 Arial; width: 841px; ">

qRegisterMetaType<QVector<double> > ("QVector<double>");</h3></span></span><div><font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">in the constructor function of ctkMatrixWidget (better: init() of ctkMatrixWidgetPrivate if it exists)</font></div>

<div><font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">j.</font></div><div><font class="Apple-style-span" face="arial, sans-serif"><br></font><div class="gmail_quote">

On Fri, Aug 19, 2011 at 11:55 AM, 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 again,<br>
<br>
so it seems that PythonQt has problems to wrap a QVector<double>. The<br>
setValues method is not accesible from python and the values() method<br>
returns:<br>
<br>
  QVector<double> (C++ Object 0x14c479690)<br>
<br>
rather than a python list. Maybe PythonQt only supports QVector<double*> ?<br>
<br>
Maybe it makes more sense to return a QVariantList which maps to<br>
python tuples in PythonQt?<br>
<br>
What do you guys think?<br>
<br>
Thanks,<br>
<font color="#888888">Daniel<br>
</font><div><div></div><div class="h5"><br>
On Wed, Aug 17, 2011 at 7:56 PM, Daniel Haehn <<a href="mailto:haehn@bwh.harvard.edu">haehn@bwh.harvard.edu</a>> wrote:<br>
> Great, thank you!<br>
><br>
> Daniel<br>
><br>
> On Wed, Aug 17, 2011 at 7:48 PM, Julien Finet <<a href="mailto:julien.finet@kitware.com">julien.finet@kitware.com</a>> wrote:<br>
>> Added in CTK:<br>
>> <a href="https://github.com/commontk/CTK/commit/5ebd60003b230f961bfb5d2c89c17f0ddcb4a151" target="_blank">https://github.com/commontk/CTK/commit/5ebd60003b230f961bfb5d2c89c17f0ddcb4a151</a><br>
>> Added in Slicer: r17743<br>
>> <a href="http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=17743" target="_blank">http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=17743</a><br>
>> Thanks,<br>
>> Julien.<br>
>><br>
>> On Wed, Aug 17, 2011 at 4:55 PM, Daniel Haehn <<a href="mailto:haehn@bwh.harvard.edu">haehn@bwh.harvard.edu</a>> wrote:<br>
>>><br>
>>> Thanks for the feedback,<br>
>>><br>
>>> I just commited<br>
>>><br>
>>> <a href="https://github.com/haehn/CTK/commit/583a229fce5d99f06b78bab1c3a38cfe4255a328" target="_blank">https://github.com/haehn/CTK/commit/583a229fce5d99f06b78bab1c3a38cfe4255a328</a><br>
>>><br>
>>> Would be great if we could encounter these changes to upstream and<br>
>>> then to Slicer CTK - the EMSegmenter needs it :)<br>
>>><br>
>>> Thx,<br>
>>> Daniel<br>
>>><br>
>>> On Wed, Aug 17, 2011 at 4:48 PM, Julien Finet <<a href="mailto:julien.finet@kitware.com">julien.finet@kitware.com</a>><br>
>>> wrote:<br>
>>> > Looks good, except that when populating the values vector<br>
>>> > (ctkMatrixWidget::values()), I would call ctkMatrixWidget::value(i,j)<br>
>>> > instead of manually querying the data in order to factorize code.<br>
>>> > Thanks,<br>
>>> > Julien.<br>
>>> > p.s.I agree that setValues() would also beneficiate from some<br>
>>> > refactorization as well, but it's another story...<br>
>>> ><br>
>>> > On Wed, Aug 17, 2011 at 4:15 PM, Daniel Haehn <<a href="mailto:haehn@bwh.harvard.edu">haehn@bwh.harvard.edu</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> Hi guys,<br>
>>> >><br>
>>> >> could you please review<br>
>>> >><br>
>>> >><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>
>>> >> Daniel<br>
>>> >><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<br>
>>> >> > <<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<br>
>>> >> >> Designer.<br>
>>> >> >> As a more philosophical point, the matrix "values" are a "property"<br>
>>> >> >> of<br>
>>> >> >> the<br>
>>> >> >> matrix.<br>
>>> >> >> Julien.<br>
>>> >> >> On Tue, Aug 16, 2011 at 3:04 PM, Daniel Haehn<br>
>>> >> >> <<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<br>
>>> >> >>> shot<br>
>>> >> >>> and let you know.<br>
>>> >> >>><br>
>>> >> >>> Cheers,<br>
>>> >> >>> Daniel<br>
>>> >> >>><br>
>>> >> >>> On Tue, Aug 16, 2011 at 1:48 PM, Julien Finet<br>
>>> >> >>> <<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>),<br>
>>> >> >>> > maybe<br>
>>> >> >>> > 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<br>
>>> >> >>> > <<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<br>
>>> >> >>> >> ctkMatrixWidget<br>
>>> >> >>> >> from Python?<br>
>>> >> >>> >><br>
>>> >> >>> >> Shall we just enable Q_INVOKABLE on the<br>
>>> >> >>> >> 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>
>>> >> >>> >><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>
>>> ><br>
>>> ><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>