#include
#include
#include
struct MyStruct
{
int i;
};
Q_DECLARE_METATYPE(MyStruct)
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MyStruct s;
s.i = 999;
QVariant var;
var.setValue(s); // copy s into the variant
MyStruct s2 = var.value();
QVariant::Type type = var.type();
int value = s2.i;
return a.exec();
}
阅读(2853) | 评论(0) | 转发(0) |