[Ctk-developers] ctkMatrixWidget: setValue not invokable from Python
Julien Finet
julien.finet at kitware.com
Wed Aug 17 20:48:20 UTC 2011
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.
Thanks,
Julien.
p.s.I agree that setValues() would also beneficiate from some
refactorization as well, but it's another story...
On Wed, Aug 17, 2011 at 4:15 PM, Daniel Haehn <haehn at bwh.harvard.edu> wrote:
> Hi guys,
>
> could you please review
>
>
> https://github.com/haehn/CTK/tree/add-SetValuesQPropertyMatrixWidget-feature
>
> Thx,
> Daniel
>
> On Tue, Aug 16, 2011 at 3:57 PM, Jean-Christophe Fillion-Robin
> <jchris.fillionr at kitware.com> wrote:
> > +1 for setValues
> > Jc
> >
> > On Tue, Aug 16, 2011 at 3:11 PM, Julien Finet <julien.finet at kitware.com>
> > wrote:
> >>
> >> Because a "Q_PROPERTY adds features through the meta-object system".
> >> Practically in this case, it allows the property to be wrapped with
> >> python, and initial values can also be set directly via the Designer.
> >> As a more philosophical point, the matrix "values" are a "property" of
> the
> >> matrix.
> >> Julien.
> >> On Tue, Aug 16, 2011 at 3:04 PM, Daniel Haehn <haehn at bwh.harvard.edu>
> >> wrote:
> >>>
> >>> Hi Julien,
> >>>
> >>> why do you think a Q_PROPERTY is better? Anyway, I will give it a shot
> >>> and let you know.
> >>>
> >>> Cheers,
> >>> Daniel
> >>>
> >>> On Tue, Aug 16, 2011 at 1:48 PM, Julien Finet <
> julien.finet at kitware.com>
> >>> wrote:
> >>> > Either that or we make a Q_PROPERTY named "values":
> >>> > Q_PROPERTY( QVector<double> values READ values WRITE setValues)
> >>> > There is already: ctkMatrixWidget::setVector(QVector<double>), maybe
> it
> >>> > could be renamed into setValues and values() should then also be
> >>> > written.
> >>> > Julien.
> >>> >
> >>> > On Tue, Aug 16, 2011 at 12:37 PM, Daniel Haehn <
> haehn at bwh.harvard.edu>
> >>> > wrote:
> >>> >>
> >>> >> Hi guys,
> >>> >>
> >>> >> it seems that it is not possible to set a value of a ctkMatrixWidget
> >>> >> from Python?
> >>> >>
> >>> >> Shall we just enable Q_INVOKABLE on the ctkMatrixWidget::setValue
> >>> >> method?
> >>> >>
> >>> >> Thanks,
> >>> >> Daniel
> >>> >> _______________________________________________
> >>> >> Ctk-developers mailing list
> >>> >> Ctk-developers at commontk.org
> >>> >> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
> >>> >
> >>> >
> >>
> >>
> >> _______________________________________________
> >> Ctk-developers mailing list
> >> Ctk-developers at commontk.org
> >> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
> >>
> >
> >
> >
> > --
> > +1 919 869 8849
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20110817/bc159883/attachment.htm>
More information about the Ctk-developers
mailing list