信号和槽
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))); --------------------编程问答-------------------- 跨线程的关联用队列的处理方式看看 --------------------编程问答-------------------- 如果不需要操作共享数据,这样可以用 --------------------编程问答-------------------- connect(FKf,SIGNAL(onLineEvent(int)), this, SLOT(onLineEvent(int)));
补充:移动开发 , Qt