[Interest] use of deleted function errors in QList / qarraydataops.h

Hamish Moffatt hamish at risingsoftware.com
Tue Feb 28 02:00:36 CET 2023


On 28/2/23 11:49, Thiago Macieira wrote:
> On Monday, 27 February 2023 16:22:46 PST Hamish Moffatt via Interest wrote:
>> How and when would Qt5 show an error? We have the above code working and
>> in production, and I'm able resize, copy and change, force a detach -
>> operations where QVector would need to copy elements.
> Ah, looks like it isn't going to. I expected the issue was that it didn't
> happen in this test case because it never detached. If you're definitely
> detaching, then this isn't the same issue.
>
> The issue here is that you have a type that is copy/move constructible, but
> cannot be copy/move assigned. That's usually a bad combination; the new QList/
> QVector code uses move-assignment when moving elements in the overlapping part
> of the list.
>
> We could determine that your type is not move-assignable and use a different
> strategy, but this isn't implemented right now. It might be less efficient; I
> wouldn't know.
>

Qt5's documentation (like Qt6's) does say "QVector's value type must be 
an assignable data type", so the mystery here is perhaps why our code 
works with Qt5.


Thanks,

Hamish



More information about the Interest mailing list