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

Q{Hash,Map}::unite "should not" insert duplicate values (RFE)

    XMLWordPrintable

Details

    • 4ec6748c6a30f74e6d8fbb90fc118b306d1fa690 c7e35ffe69a73bb144618714313673f0d0c28394

    Description

      I have an application that receives asynchronous data updates and stores them in a QMap. In order to reduce signalling, multiple updates may be transmitted also as a QMap. Therefore, I need to take each key/value pair in the input and insert it into the store.

      At face value, this seems like exactly what QMap::unite would do, but it isn't, as unite() creates duplicate values (a la insertMulti()). Especially as QMap is "not supposed to" contain duplicate values normally, it would be useful if unite() would take a second parameter specifying how duplicates should be handled, e.g. KeepDuplicates or ReplaceDuplicates (possible also IgnoreDuplicates). QHash should have the same improvement.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-35544
          # Subject Branch Project Status CR V

          Activity

            People

              manordheim Mårten Nordheim
              matthew.woehlke Matthew Woehlke
              Maurice Kalinowski Maurice Kalinowski
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes