QVariant v; unsigned char ucvalue = v.value<unsigned char>();