Yes, as described in 
https://doc.qt.io/qt-6/qtcore-changes-qt6.html#stability-of-references, Qt 6's 
QHash does indeed intentionally no longer promise reference stability when it 
grows or elements are removed.
--
Fabian Kosmale
Software Engineer

The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin
[email protected]
+49 1638686070
http://qt.io


Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 144331 B

--

________________________________________
Von: Development <[email protected]> im Auftrag von Иван 
Комиссаров <[email protected]>
Gesendet: Donnerstag, 18. März 2021 16:04
An: Qt development mailing list
Betreff: [Development] QHash references stability in Qt6

Hello, when porting Qbs to Qt6 I’ve noticed a lot of bugs/crashes when using 
QHash. With Qt5 that was never a problem and simple change QHash -> 
std::unordered_map fixes those.

From what I understood all affected places rely on the fact that QHash in Qt5 
(as well as std::unordered_map) guarantees that references are not invalidated 
even in case of re-hashing.

So I am wondering if this is the case with the new QHash implementation or is 
it just a bug (I could not find anything related on the bug tracker though)

Ivan
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to