信号槽传递自定义结构体

struct mystruct {
	int a,
	int b
};
Q_DECLARE_METATYPE(mystruct)
connect(this, SIGNAL(mysignal(variant), this, SLOT(myslot(variant));
mystruct st;
QVariant v;
v.setvalue(st);
emit mysignal(v);

data.value<mystruct>();  //接收
Table of Contents