qt与python之间怎么建立信号槽链接
1个回答
展开全部
(1)类中信号与槽连接
connect(ui->action_Open, SIGNAL(triggered()), this, SLOT(showOpenFileDlg()));11
(2)类之间槽的连接
//类间信号与槽连接,但是没有传递数据
geometryTransform* geomtry = new geometryTransform();//实例化类的对象
connect(ui->action_Scale, SIGNAL(triggered()), geomtry, SLOT(scale()));123123
//类间信号与槽连接,并且传递数据
imageEnhance* imgEnhance = = new imageEnhance();//实例化类的对象
//A->B->A,A 向B发送信号,B执行处理,处理结果再返回A显示,即操作与显示分开,更合理
connect(ui->action_MediumFilter, SIGNAL(triggered()), this, SLOT(sendQPixmap()));
connect(this,SIGNAL(getQPixmap(QString)), imgEnhance, SLOT(meanFilter(QString)));
connect(imgEnhance, SIGNAL(getQpixmap(QPixmap*)), this,SLOT(updateView(QPixmap*)))
connect(ui->action_Open, SIGNAL(triggered()), this, SLOT(showOpenFileDlg()));11
(2)类之间槽的连接
//类间信号与槽连接,但是没有传递数据
geometryTransform* geomtry = new geometryTransform();//实例化类的对象
connect(ui->action_Scale, SIGNAL(triggered()), geomtry, SLOT(scale()));123123
//类间信号与槽连接,并且传递数据
imageEnhance* imgEnhance = = new imageEnhance();//实例化类的对象
//A->B->A,A 向B发送信号,B执行处理,处理结果再返回A显示,即操作与显示分开,更合理
connect(ui->action_MediumFilter, SIGNAL(triggered()), this, SLOT(sendQPixmap()));
connect(this,SIGNAL(getQPixmap(QString)), imgEnhance, SLOT(meanFilter(QString)));
connect(imgEnhance, SIGNAL(getQpixmap(QPixmap*)), this,SLOT(updateView(QPixmap*)))
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询