Il 21/02/19 22:47, Matthew Woehlke ha scritto:
So... after a full day of debugging, trying to port my Qt4 app to Qt5 and chase down a nasty case of stack clobbering, I discovered that the problem is that QMatrix4x4 changed from qreal to float.(Uh...why? I am not particularly amused by the loss of precision, nor the extremely subtle incompatibility.)
IIRC the idea in Qt 5 was that:* QMatrix, QTransform, QPointF, QRectF and so on were "raster engine" (aka CPU-rasterizer) datatypes, therefore using qreal (so either double or float depending on how you build Qt);
* QMatrix4x4, QVectorND and so on were types for OpenGL integration, therefore only using float.
The fact that you can use QMatrix4x4 on a QPointF is IMNSHO an API mistake. The two shouldn't mix together "transparently", if the intention is the one above.
Alas, there does not seem to be any feasible replacement in Qt. I can't use QGenericMatrix because it can't be used to transform QPointF's, nor can it be inverted, both of which are features I require. I*really* don't want to throw out the precision of double, especially as I have tons of other code that still uses double and would have to wade through mountains of conversion warnings to do so. Am I missing something, or do I need to drag in Eigen?
You're not missing anything. But maybe you can use something simpler, like GLM's dmat4?
My 2 c, -- Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com KDAB - The Qt, C++ and OpenGL Experts
smime.p7s
Description: Firma crittografica S/MIME
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest