Mihail Naydenov wrote: > > > > ----- Original Message ---- >> From: Thiago Macieira <[email protected]> >> To: [email protected] >> Sent: Mon, October 26, 2009 11:07:35 AM >> Subject: Re: [Qt4-preview-feedback] Please make QVector* private members >> protected >> >> Em Sábado 24 Outubro 2009, às 10:18:58, você escreveu: >>> Hi, I mentioned this in a diff. mail ( about QPoint), but the issue rises >>> again here with the new QVector(s) (which are great). >>> >>> Please make the private members (xp, yp) protected, so users can subclass >>> and extend these classes more easily and natural. >>> >>> Also, as for now, QVector* does not even have reference access to these >>> members (as QPoint/QSize/etc does), but still, please consider protected >>> membership first! >> Sorry, we're not going to do that. >> >> QVector internals change from one version to the other. In Qt 4.6, for >> example, we renamed the d and p members, changed the inheritance of >> QVectorTypedDatafrom public to private and I'm in the process of changing >> the allocator too. > > Thank You for your response, but its a bit misunderstanding. > > I was talking about "math" vector classes QVector2D/3D/4D. > > I find it convenient to add some conversions and more features to sub-classes > of those. > And it feels natural to access the internals directly. > > Considering 4.6 is not released yet, it is the perfect time to make this > adjustment. > MihailNaydenov
QPoint has rx() and ry() reference accessors. If we decide to add those to QVector2D it can always happen at a later point, but I'm not sure if I see a use case for it. The classes aren't meant to be extended, helper functions can always be put on the outside of the classes. Also, if you want access to the raw data you can do reinterpret_cast<float *>(&v) -- Samuel _______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
