Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21035

Using qreal in QVector2D, QVector3D, QVector4D, etc...

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 4.6.0, 4.7.0, 4.8.0
    • Fix Version/s: 5.0.0
    • Labels:
      None
    • Commits:
      51d40d7e9bdfc63c5109aef5b732aa2ba10f985a

      Description

      I noticed that QVector2D, QVector3D, QVector4D, etc... use floats as the storage type and I recognize that it was a performance decision to do it this way. I am just wondering why the getters and setters for the structures use qreal as the parameter type instead of floats.

      I know that on a mobile system qreal is a float, but on desktop systems qreal is a double. I would like to use these data structures but the conversion from double to float only to be accessed as a double again seems to be overly expensive.

      I think it would be best to have all functions use floats instead of qreals in Qt version 5.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            seanharmer Sean Harmer
            Reporter:
            kreios4004 Keith Gardner
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes