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

Add a distance function to QPointF

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • Core: Other
    • None

      I think the QPointF class should provide a static function to compute the distance between two points. It is very unintuitive to call QLineF(p1,p2).length() just to get distance between two points.

      Instead something like 

       

      static qreal QPointF::distance(QPointF const &p1, QPointF const &p2)
      

      should be provided. As a bonus, a "distancesquared" function could also be included.

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

            thiago Thiago Macieira
            daljit97 Daljit Singh
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes