qt信号和槽

类定义时:

class A {

Q_SIGNALS:
void syncinitApp(NQIntent *pIntent );

private Q_SLOTS:
void onSyncinitApp(NQIntent *pIntent );

}

可在构造函数中进行:connect(this, SIGNAL(syncinitApp(NQIntent *)), this, SLOT(onSyncinitApp(NQIntent *)));

可在析构函数中进行:disconnect(this, SIGNAL(syncinitApp(NQIntent *)), this, SLOT(onSyncinitApp(NQIntent *)));

可在需要跳转处:emit syncinitApp(pNQIntent);

猜你喜欢

转载自www.cnblogs.com/mayfly-xlc/p/9356001.html