[Development] Lack of base classes/interfaces? Q*, Q*F

Jason H jhihn at gmx.com
Mon Apr 17 19:33:06 CEST 2017



> Sent: Monday, April 17, 2017 at 3:30 AM
> From: "Alejandro Exojo" <alex at vikingsoft.eu>
> To: development at qt-project.org
> Subject: Re: [Development] Lack of base classes/interfaces? Q*, Q*F
>
> On Monday 17 April 2017 03:25:49 Jason H wrote:
> > I am wondering why all the Q* and Q*F classes (where $1 in [Rect, Point,
> > etc]) don't use an interface? I recently moved some code from ints to
> > floats, and I had to change far more code than I should have had to.
> > 
> > My proposal is to change QRect to QRectI, and make QRect an interface.
> 
> Have you thought this through? What would that interface or base class return 
> for x()/y()/width(), etc?

Not really. I've been spending a lot of time in Python and I think that has twisted by brain around a bit. So that is my mistake. on any given day I'm using 3 languages from a set of 4 - C++, Java, Python, JS so I do get some mechanics confused, as well as not remembering the finer details of the particular language of the hour.

After some more thought, I think what I need are C++ templates. So let me rephrase: Why not QRect<int> and QRect<double>? 
Also I'm still not sure though why there isn't an interface for QVector/QList? The main things are operator [], at(), size(), etc. 




More information about the Development mailing list