16,216
社区成员
发帖
与我相关
我的任务
分享
GoToCellDialog::GoToCellDialog(QWidget *parent)
:QDialog(parent)
{
setupUi(this);
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
QRegExp regExp("[A-Za-z][1-9][0-9]{0, 2}");
lineEdit->setValidator(new QRegExpValidator(regExp, this));
// lineEdit->keyboardGrabber();
// lineEdit->activateWindow();
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
void GoToCellDialog::on_lineEdit_textChanged()
{
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
lineEdit->hasAcceptableInput());
}