[Interest] QVariant compare operator

evilruff evilruff at gmail.com
Sat Apr 18 00:15:56 CEST 2020


Hi,Recently I was debugging one of my project and ended up with something which really surprise me.Are there any special reasons why QVariant compare < not fully cover appropriate operators from other Qt classes.For example QByteArray has own operator < but within QVariant switch QByteArray type just defaults to toString() which for QByteArray is toUtf8() leads to fact that if you have:QByteArray a,b;Knowning that a < b is true, QVariant(a) < QVariant(b) may be false..Thats really really inconvinient especially working with ModelView concept which is QVariant based..Sort of workaround might be to allow toString custom replacing for Qt classes but still I will really appreceate if somebody explains me reasons for such strange concept to implement own comparasion within QVariant rather then using already existing operators.RegardsYuriОтправлено со смартфона Samsung Galaxy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200418/a6c5ae50/attachment.html>


More information about the Interest mailing list