[Interest] QMap::keys() / Qt6

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Mon Jan 1 20:59:13 CET 2018


currently QMap::keys() returns a QList<T>. Since some newer APIs already 
using QVector, a conversion from QList to QVector is needed which 
creates a double allocation when using the easy way (with a clazy 
warning and hopefully a comment in the review).
So to avoid this, I have to write some code to put the keys into a 
QVector. The problems I've with this solutions are
  - everyone needs to write his own function
  - it is (maybe) not catched during Qt6 porting, esp. when using auto, 
and we do useless conversions

Is it possible to add a helper function for this somewhere (or is it 
already available) or another easier way?


More information about the Interest mailing list