Re: [Development] Notes from the Containers session from QtCS

2012-06-25 Thread Nils Jeisecke
> Submit the change and add Casper as a reviewer :-) Done. https://codereview.qt-project.org/#change,29361 ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development

Re: [Development] Notes from the Containers session from QtCS

2012-06-25 Thread Thiago Macieira
On segunda-feira, 25 de junho de 2012 16.26.34, Nils Jeisecke wrote: > "If your data class uses a > QSharedDataPointer/QExplicitlySharedDataPointer as the only member you > should consider marking your data class as a movable type (link to > Q_DECLARE_TYPEINFO) in order to improve performance when

Re: [Development] Notes from the Containers session from QtCS

2012-06-25 Thread Nils Jeisecke
Hi, >> I assume that classes using a QSharedDataPointer are movable, correct? > Yes, but we have to mark them each as such. I meant "are candidates for marking as movable" ;-) > Yes, but I'm afraid of that recommendation in our docs. It may be read and > used by people who don't know exactly what

Re: [Development] Notes from the Containers session from QtCS

2012-06-25 Thread Thiago Macieira
On segunda-feira, 25 de junho de 2012 15.39.07, Nils Jeisecke wrote: > Hi, > > I assume that classes using a QSharedDataPointer are movable, correct? Yes, but we have to mark them each as such. qshareddata.h has: template Q_DECLARE_TYPEINFO_BODY(QSharedDataPointer, Q_MOVABLE_TYPE); template Q_DEC

Re: [Development] Notes from the Containers session from QtCS

2012-06-25 Thread Nils Jeisecke
Hi, I assume that classes using a QSharedDataPointer are movable, correct? As the container implementation cannot detect this automatically maybe the QSharedDataPointer documentation should suggest to use Q_DECLARE_TYPEINFO(ClassName, Q_MOVABLE_TYPE) for such classes. Nils __

Re: [Development] Notes from the Containers session from QtCS

2012-06-24 Thread Thiago Macieira
On domingo, 24 de junho de 2012 22.13.58, André Pönitz wrote: > For some reason I forgot to mention that with the current guarantee for > fromRawData usage (user has to make sure that the base data will not be > deleted or modified as long as the QString (or an unmodified copy of it) > exists) this

Re: [Development] Notes from the Containers session from QtCS

2012-06-24 Thread André Pönitz
On Sun, Jun 24, 2012 at 09:08:45PM +0200, Thiago Macieira wrote: > André suggested a container main class as: class QString { ushort *data; > int size; int d_offset; }; > > so that d = reinterpret_cast(data) + d_offset. > > That class has 16 bytes in size. However, it breaks for fromRawData, > si

[Development] Notes from the Containers session from QtCS

2012-06-24 Thread Thiago Macieira
We discussed the containers, including performance issues and why the design was going to where it was going. QList ~~~ Since QList is the most used container in Qt and by Qt users, it's probably being used in unexpected ways. We preferred not to break compatibility. QList will continue to have a