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

QHash, QMultiHash operator== is broken

    XMLWordPrintable

Details

    • dbd55cdaf367bdc9d6774bcb9927cbe19f18065f 4084f96052ea1568c847f8cfb52b6ae6d205ec4d

    Description

      This code

      #include <QtCore>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QHash<int, int> h1, h2;
          h1.insertMulti(0, 0);
          h1.insertMulti(0, 1);
      
          h2.insertMulti(0, 1);
          h2.insertMulti(0, 0);
      
          Q_ASSERT(h1 == h2);
      }
      

      asserts. Same with QMap and the Multi variants. A quick peek at the operator== shows that they're completely wrong for the multikey case.

      Attachments

        Issue Links

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

          Activity

            People

              peppe Giuseppe D'Angelo
              peppe Giuseppe D'Angelo
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes