Описание тега qvariant
QVariant is a data type in Qt library, that acts as a "container" for most of the common Qt data types.
QVariant
can contain most of the basic Qt data types, and perform easy conversions between them. QVariant
can also contain tree-like structures, which is shown in this small example:
//Creating a list of QVariants.
QVariantList myList;
//Creating a single QVariant variable
QVariant var;
//Populating the list with different types
myList << "Hello, world!";
myList << 15;
myList << 0x0A;
//After the following assignment, the variable will hold the list.
var = myList;
The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.