Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8.0, 6.9.0 FF
-
None
-
2
-
0d4fd5c54 (dev), 2d1b30286 (dev), 68cac07d5 (dev), 3dff1a3f7 (6.9), 12f39bb2a (6.9), 0e17856f6 (6.8), 88d9371d2 (6.8), 03f6f176b (dev), c52fc83d9 (tqtc/lts-6.5), 40434eec8 (tqtc/lts-6.2), 84cbcf52c (tqtc/lts-5.15)
-
Foundation Sprint 122, Foundation Sprint 123, Foundation Sprint 124
Description
https://doc.qt.io/qt-6/qset.html#unite says:
Each item in the other set that isn't already in this set is inserted into this set.
This is not what the implementation does:
for (const auto &e : std::as_const(other)) insert(e);
(Created QTBUG-132503 to deal with this).
Since https://codereview.qt-project.org/c/qt/qtbase/+/531872, which set is *this and which is other is now "random", a regression from 6.7.
By Hyrum's Law, users may have some to expect that unite() works as implemented, meaning that equivalent elements of other overwrite elements of *this. Restore the old behavior.
Attachments
Issue Links
- is cloned by
-
QTBUG-132536 QSet::intersect() picks equivalent elements inconsistently from `other` or *this
-
- Closed
-
- relates to
-
QTBUG-132503 QSet::unite docs don't match implementation
-
- Closed
-
For Gerrit Dashboard: QTBUG-132500 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
614343,15 | Revert "Optimize QSet::unite" | dev | qt/qtbase | Status: MERGED | +2 | 0 |
614372,12 | QSet: check that unite() and intersect() prefer elements from *this | dev | qt/qtbase | Status: MERGED | +2 | 0 |
616953,8 | QSet: add an rvalue overload of unite() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
622364,2 | QSet: check that unite() and intersect() prefer elements from *this | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
622401,2 | Revert "Optimize QSet::unite" | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
622674,2 | QSet: check that unite() and intersect() prefer elements from *this | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
622695,2 | Revert "Optimize QSet::unite" | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
622737,3 | QSet: check that unite() and intersect() prefer elements from *this | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | +1 |
623191,2 | QSet: Fix Qt Creator build | dev | qt/qtbase | Status: MERGED | +2 | 0 |
624295,2 | QSet: check that unite() and intersect() prefer elements from *this | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
624354,3 | QSet: check that unite() and intersect() prefer elements from *this | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | -1 |