[Interest] Strange QvariantList/QVariant problem

Guido Seifert wargand at gmx.de
Mon Nov 25 17:00:16 CET 2013


Hi,
I have here a strange effect and I wonder if this is the correct behaviour.

I have a QVariantList x.
I add a few values
x << <int>
x << <QString>
x << <bool>

Now I create a second QVariantList y and add a few values:
y << 1.5
y << 3.5

And add the list y to x:
x << y

Now I would expect that x has:
One int, one QString, one bool and one QVariantList with two doubles.
Actually I get one int, one QString, one bool, and two doubles.

Instead of four my  x list has five values. The second QVariantList gets 'flattened'.

Is this to be expected? 


Guido



More information about the Interest mailing list