unionData
{
char c;
uchar uc;
short s;
signedchar sc;
ushort us;
int i;
uint u;
long l;
ulong ul;
bool b;
double d;
float f;
qreal real;
qlonglong ll;
qulonglong ull;
QObject *o;
void *ptr;
PrivateShared*shared;
};
QVariant介绍(来自Qt助手)
The QVariant class acts like a union for the most common Qt datatypes.
Because C++forbids unions from including types that have non-default constructors ordestructors, most interesting Qt classes cannot be used in unions. Without QVariant, this would be a problem for