fix: Alert dialog render bug

This commit is contained in:
chenhuijun
2024-07-19 16:09:19 +08:00
parent d9b903e1e3
commit 3cd25d8fbc
6 changed files with 59 additions and 4 deletions

View File

@@ -159,7 +159,7 @@ void SelectFormWidget::delPatient() {
}
// not the selected one, confirm!
QString pat_name = mModel->index(mPatTable->currentIndex().row(), Name).data().toString();
if (DialogManager::Default()->requestAlertMessage(QString(tr("Delete Patient \"%1\" ?")).arg(pat_name),DialogButtonMode::OkAndCancel,tr("Confirm")) != QDialog::Accepted) return;
if (DialogManager::Default()->requestAlertMessage(QString(tr("Delete Patient \"%1\" ?")),pat_name,DialogButtonMode::OkAndCancel,tr("Confirm")) != QDialog::Accepted) return;
// need delete clear edit panel detail
patientDetailForm->clearPatientInformation();
//mModel->setData(mModel->index(mPatTable->currentIndex().row(), Flag), 9);

View File

@@ -127,7 +127,7 @@ AccountTableForm::AccountTableForm(QWidget* aParent)
return;
}
if ( DialogManager::Default()->requestAlertMessage(QString(tr("Delete account with ID:\"%1\"!")).arg(id), DialogButtonMode::OkAndCancel) != QDialog::Accepted) return;
if ( DialogManager::Default()->requestAlertMessage(QString(tr("Delete account with ID:\"%1\"!")), id, DialogButtonMode::OkAndCancel) != QDialog::Accepted) return;
model->removeRow(mCurrentRow);
model->select();
mCurrentRow = model->rowCount() > mCurrentRow + 1 ? mCurrentRow : mCurrentRow - 1;