在index.h中定义
public slots:
void pushButtonNum(int num);
在index.cpp中连接信号与槽
connect(PushButton1,SIGNAL(clicked()),this,SLOT(close()));
connect(pushButton2,SIGNAL(clicked()),this,SLOT(pushButtonNum(100)));
void QTE2TEST::pushButtonNum(int num)
{
//int num=100;
LineEdit1->setText(QString::number(num,10));
}
编译时没有错误,但在运行时出现如下错误:
[root@liu ts-test]# QObject::connect: No such slot QTE2TEST::pushButtonNum(100)
QObject::connect: (sender name: 'pushButton2')
QObject::connect: (receiver name: 'QTE2TEST')
请问大家为什么会出错啊?
[ 此贴被XChinux在2005-12-27 10:50重新编辑 ]