[Development] Proposal: QVariant/std::any QModelIndex::internalData() for Qt 7
Thiago Macieira
thiago.macieira at intel.com
Thu Jul 2 19:21:58 CEST 2026
On Thursday, 2 July 2026 03:52:32 Pacific Daylight Time Volker Hilsheimer via
Development wrote:
> Expanding QModelIndex to be more than a short-lived reference to an item in
> the model would perhaps make some specific use cases easier - but at very
> high cost (like heap-allocated QVariants).
Do note that QVariant avoids heap for typical payloads, including void* and
quintptr. Accessing those using .value<T>() is also inline as of 6.12.
However, using it will make QModelIndex not trivially copyable, movable
(though moving is inline), or destructible. For large models, this could be a
problem.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCG - Platform & Sys. Eng.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5176 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20260702/3304ee2b/attachment.bin>
More information about the Development
mailing list