[Interest] QPointF constructor from QPoint

Christoph Feck christoph at maxiom.de
Wed Sep 19 11:05:55 CEST 2012

On Wednesday 19 September 2012 04:31:33 Shriramana Sharma wrote:
> Hello. I ran into this recently: Is there a reason that there is
> currently (4.8.1) no constructor for QPointF from QPoint? I can
> understand that QPointF should be explicitly converted to QPoint
> since it involves a loss of precision but just as integers are
> accepted everywhere that doubles are, it would be most useful
> (code less create more) if QPoint is accepted everywhere that
> QPointF is.
> Sent from my Android phone

The conversion constructor isn't explicit, because on some systems, 
qreal != double, so conversion from int to qreal actually does involve 
loss of precision.

Christoph Feck
KDE Quality Team

More information about the Interest mailing list