Open ghost opened 7 years ago
variant.c#L32 probably doesn't matter since it will return a variant with deep copied data, within the scope of that function.
So it does copying. It seems docs are correct :) http://doc.qt.io/qt-5/qstring.html#QString-7
The docs are ambiguous when one is doubtful. They say that most Qt containers work with shallow copies but then they don't always highlight in the constructor documentation if and when it does deep-copying, although it does.
This is all ok, till a cross-thread, cross-memory-manager, corruption occurs and then everything is doubtful.
Of course Qt's documentation is written for those working within certain scope of the framework.
It is not clear if: https://github.com/Kakadu/lablqml/blob/orbifx/object-subclass/lib/stubs/variant.c#L13
is making a deep copy of the string.
Might be better to use QVariant(const *char) which explicitly states deep copy.
It's not clear if: https://github.com/Kakadu/lablqml/blob/orbifx/object-subclass/lib/stubs/variant.c#L32
is thread safe.