Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946
QStringRef to QVariant (for use with QStandardItemModel/QModelIndex)
utcenter last edited by
I changed from using QString to using QStringRef, since I keep the original string, however QStringRef doesn't "cast" to QVariant, which is needed to use with QStandardItemModel/QModelIndex, forcing me to use QStringRef::toString() and making the entire optimization pointless.
I am not that familiar with QVariant, so my question is who can I proceed in order to avoid the unnecessary duplication of memory?
twsimpson last edited by
You must copy, QVariant always contains a copy of the original data as it's a value type