信号和槽

haoyunlailai haoyunlailai 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Kf.h:

class CKf : public QThread
{
Q_OBJECT
public:
explicit CKf();
protected:

signals:
void OnLineEvent(int val);

};


class COKf :public CKf
{
Q_OBJECT
public:
explicit COKf();

protected:

signals:

protected slots:
};


MainWindow.h:

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = 0);

~MainWindow();

private:
Ui::MainWindow *ui;
COKf FKf;

public slots:
void OnLineEvent(int val);
};


MainWindow.cpp:

想把类中OnIOEvent信号关联到MainWindow的槽怎么实现,这样好像不对connect(FKf,SIGNAL(onLineEvent(bool)), this, SLOT(onLineEvent(bool)));
...全文
评论 3
收藏 已收藏
分享
返回顶部
haoyunlailai
Qt 21,503 成员 26,693 内容