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

Add a distance function to QPointF

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes