Hello, I hope I am not missing something obvious here, but it seems the QCOMPARE toString() behaviour has changed a bit for QListful of custom items, and specializing the custom list toString() does not seem to work anymore (fine as such, see below)
To make it work, it seems one needs to implement the template specialization version of the toString() function for the individual element. The somewhat confusing bit is that the documentation currently discourages this way for things beyond Qt 5.5+, but for QList of custom items that seems the only way? Unless I am missing something of course.
As such this seems fine to me (more convenient), but if this is indeed the intended behaviour , perhaps it should be documented into the https://doc-snapshots.qt.io/qt6-dev/qtest.html#toString
Anyway here's a small test code to illustrate it:
|For Gerrit Dashboard: QTBUG-89737|
|328409,4||QTestlib: Fix custom toString() implementations for QList comparison||dev||qt/qtbase||Status: MERGED||+2||0|
|329227,2||QTestlib: Fix custom toString() implementations for QList comparison||6.0||qt/qtbase||Status: MERGED||+2||0|