QT使用QRegExp内存泄漏是怎么回事?请高手帮忙!
#include "gotocell.h"#include "ui_gotocell.h"GoToCell::GoToCell(QWidget *parent) : QWidget(parent), ui(new Ui::GoToCell){ ui->setupUi(this); QRegExp regExp("[a-z]"); QRegExpValidator *regExpVali = new QRegExpValidator(regExp,this); lineEdit -> setValidator(regExpVali);}GoToCell::~GoToCell(){ delete ui;}void GoToCell::on_lineEdit_textChanged(){ butOk -> setEnabled(lineEdit -> hasAcceptableInput()); int i=0;}
[color=#FF0000]lineEdit = new QLineEdit[/color];lineEdit -> setValidator(regExpVali);()
[解决办法]