跟着programming with QT 4,用Creator进行到第二部分。
化好了界面,然后需要引用界面接中button,进行判断lineEdit中是否有东西,而激活。
在主头文件中加入
private slots:
void on_lineEdit_textChanged(QString );
在CPP文件中,加入
void GoToCellDialog::on_lineEdit_textChanged()
{
okButton->setEnabled(lineEdit->hasAcceptableInput());
}
调试结果,为
C:/Documents and Settings/S/My Documents/Five/mainwindow.cpp:18: error: `okButton' undeclared (first use this function);
C:/Documents and Settings/S/My Documents/Five/mainwindow.cpp:18: error: `lineEdit' undeclared (first use this function);
CPP中已经加入了代码:
#include "ui_mainwindow.h"
请高手解决问题