标题:求助:一个关于signal slot 的问题
作者:chenpeib
日期:2006-09-20 22:02
内容:
// 头文件定义
...
public slots:
void changeButtonstate( const QString &s );
//cpp 文件
//构造函数
connect( lineEdit,SIGNAL( textChanged ( const QString & text)),
this,SLOT( changeButtonstate( const QString &s )));
sendButton->setEnabled( false );
//*****************
void Dialog::changeButtonstate( constQString &s )
{
.......
}
为什么lineEdit的内容改变之后没有执行上面这个函数?
#1 [style 09-21 13:42]
应该不会吧
#2 [chenpeib 09-23 09:21]
connect( lineEdit,SIGNAL( textChanged ( const QString &)),
this,SLOT( changeButtonstate( const QString & )));
去掉参数名就可以了,不知何解,有谁能解释一下吗?
#3 [style 09-25 00:10]
是不是你类声明中给了参数名,并且和你一楼写的不对相应?
#4 [wangowen 09-26 20:14]
传递的参数必须相同,而且要只有一个,如果发送的参数多余一个会忽略后面的
#5 [cavendish 10-20 04:31]
去看看信号和槽的文档
connect里面只能写类型