On 8 January 2016 at 17:10, Tomaz Canabrava <[email protected]> wrote: > > > On Fri, Jan 8, 2016 at 1:04 PM, Lubomir I. Ivanov <[email protected]> > wrote: >> >> On 8 January 2016 at 17:02, Tomaz Canabrava <[email protected]> wrote: >> > >> > >> > On Fri, Jan 8, 2016 at 1:00 PM, Lubomir I. Ivanov <[email protected]> >> > wrote: >> >> >> >> On 8 January 2016 at 16:48, Tomaz Canabrava <[email protected]> wrote: >> >> > Dirk asked for a reworked set of patches, here they are. >> >> >> >> + Q_PROPERTY(QStringList weights READ weights CONSTANT) >> >> + Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT) >> >> >> >> is it still possible to get cylinder0 - cylinderN and >> >> wieght0...weigthN as Grantlee variables? >> > >> > >> > I tested the grantlee printings and didn't found anything wrong, I may >> > have >> > missed something, >> > but I think it supports it. >> > >> >> i'm asking because, i don't see the support for the xxx0-N variables, >> which is even documented, but mind that these are not used in the >> bundled templates. >> if these are broken then the patches cause a regression. > > > well - I'll ask to apply the patches anyhow, and I'll create a test template > to test for cylinder / weigths 0-8 > I do belive it works because http://www.grantlee.org/apidox/for_app_dev.html > shows some support for lists, and QStringList is just a typedef for > QList<QString> >
ok, basically these: -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 0); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 1); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 2); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 3); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 4); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 5); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 6); -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 7); .... -else _RETURN_DIVE_PROPERTY_IDX(weight, 0); -else _RETURN_DIVE_PROPERTY_IDX(weight, 1); -else _RETURN_DIVE_PROPERTY_IDX(weight, 2); -else _RETURN_DIVE_PROPERTY_IDX(weight, 3); -else _RETURN_DIVE_PROPERTY_IDX(weight, 4); -else _RETURN_DIVE_PROPERTY_IDX(weight, 5); called these methods: Object.cylinder(0-7) Object.weight(0-5) and the "if...then...else" thing was certainly cumbersome. i don't see a property (Q_PROPERTY) for weight0 for instance and i'm not sure how that would work. the direct QStringList exposure from Grantlee HTML is a mystery to me (e.g. is that a weights[0]?). if you modify the variables in any way let me know so that i can update the docs. lubomir -- _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
