(1)Reciver对象可能有多个方法,qt如何知道要调用哪个函数详解
我们从QMetaObjectPrivate::connect(sender, signal_index, receiver, method_index, type, types)
函数入手。sender, receiver是外部传入的参数,signal_index, method_index是两个int。signal,method是字符串。QObject::connect(s,SIGNAL(send(int)),r1,SLOT(count(int)))中,SIGNAL(send(int))产生signal,内容为 "send(int)", SLOT(count(int))产生method,内容为 "1count(int)"。Connect函数中,先得到sender的元对象smeta = sender->metaObject(),然后通过这......
阅读全文