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

implement qHash(const QRectF &)

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.6
    • None

      If you declare something like

          QHash<QRectF, MyClass*> m_monitoredAreas;
      

      you will run into the problem that qHash is not defined for QRectF. It seems like something we could provide. My naive implementation is

      uint qHash(const QRectF &r) {
          return qHash(r.width() * 1000000000 + r.height() * 1000000 + r.x() * 1000 + r.y());
      }
      

      At least it's possible to do this in the application.

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

            Unassigned Unassigned
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes