PDA

View Full Version : What is multi-variant string?



hugh_lou
21st October 2011, 08:09
Hey:
I just read the documentation about Qt::TextFlag.
There is a sentence "Always use the longest variant when computing the size of a multi-variant string.".
Can anybody tell me what the "multi-variant string" is?

Thanks~~

d_stranz
22nd October 2011, 21:41
I think it means that when you set multiple TextFlag options, each of which can cause an increase in the length of a string (by adding CRLF, tabs, etc.) then you should use the flag that could cause the largest possible increase in size when computing the length. I have no idea how one would determine which flag that would be, and by how much it increases the length.

The use of the word "variant" is unfortunate, since it obviously causes confusion with QVariant and in this context has nothing to do with that. In this usage, variant and multi-variant are used in their traditional sense: to describe one (the "variant") of multiple possibilities (the "multi-variant").