feat: Add input validator in recon page.

This commit is contained in:
sunwen
2024-06-21 15:21:14 +08:00
parent b61a2d178d
commit 363ca14ec7

View File

@@ -2,6 +2,7 @@
#include "ui_ScanSearchCriteriaForm.h"
#include <QDate>
#include <QRegExpValidator>
#include <QDebug>
#include "components/ListBox.h"
@@ -47,8 +48,11 @@ ScanSearchCriteriaForm::ScanSearchCriteriaForm(QWidget *parent)
ui->holder1->setObjectName("endSpaceLine");
ui->mPatientIDEdit->setEnabled(!JsonObject::Instance()->getAnonymousMode());
ui->mPatientIDEdit->setValidator(new QRegExpValidator(QRegExp("[a-zA-z0-9]+$"), ui->mPatientIDEdit));
ui->mPatientNameEdit->setEnabled(!JsonObject::Instance()->getAnonymousMode());
ui->mPatientNameEdit->setValidator(new QRegExpValidator(QRegExp("^[A-Za-z0-9\u4e00-\u9fa5]+$"), ui->mPatientNameEdit));
ui->mAccessionNumberEdit->setEnabled(!JsonObject::Instance()->getAnonymousMode());
ui->mAccessionNumberEdit->setValidator(new QRegExpValidator(QRegExp("[a-zA-z0-9]+$"), ui->mAccessionNumberEdit));
ui->mClearButton->setEnabled(!JsonObject::Instance()->getAnonymousMode());
ui->mRetrieveButton->setEnabled(!JsonObject::Instance()->getAnonymousMode());
ui->mRefreshButton->setEnabled(!JsonObject::Instance()->getAnonymousMode());