[Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

Simon Hausmann Simon.Hausmann at qt.io
Mon Jul 11 11:59:34 CEST 2016


Hi,


Could you elaborate on what you see as the discrepancy between docs and implementation? The docs don't say whether

it's a shallow or a deep copy, so it looks to me that the implementation is within the bounds of the docs.


Plus it seems sensible to return a shallow copy, doesn't it?



Simon

________________________________
From: Development <development-bounces+simon.hausmann=qt.io at qt-project.org> on behalf of Tomasz Olszak <olszak.tomasz at gmail.com>
Sent: Monday, July 11, 2016 11:38:06 AM
To: development at qt-project.org
Subject: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

Hello,

QImage:: transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) docs:

"Returns a copy of the image that is transformed using the given transformation matrix and transformation mode."

But if matrix.type() == QTransform::TxNone then shallow instead of deep copy is returned.

I'm happy to submit a fix but I don't know what is expected behaviour? Should implementation follow docs or docs or docs follow implementation here?

T.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160711/06fea613/attachment.html>


More information about the Development mailing list