[Development] QQuaternion issues with new 5.5 API

Marc Mutz marc.mutz at kdab.com
Fri Apr 24 14:33:27 CEST 2015


Hi,

While implementing qHash() overloads for gui/math3d classes, I found that 
QQuaternion gained several methods for 5.5 which I don't like:

*EulerAngles():

They are missing a QEulerAngles class. Instead, they deal with (float, float, 
float) and QVector3D. One function even returns three floats as out-
parameters. I think my (partial) work on QDate/Time has shown just how much 
compilers don't like out parameters. The question here is how general such a 
QEulerAngles class should be...

*AxisAndAngle()/*Axes():

Same here, to a lesser extent. What bugs me most is the return-by-out-
parameters, not so much that there's no QAxis3D class.

There are several steps forward:

- Create QEulerAngles as a float-only class
- ditto, but as a template
- ditto, but also add Q*Angle classes that have DEG/RAD hard-coded as template
  arguments, with explicit conversions between, then use that in QEulerAngles.
  [this likely won't happen for 5.5, though]
- remove the methods in question for 5.5 and try again in 5.6

Any opinions about which ones to take?

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts



More information about the Development mailing list