From 1cf53afb22aad262cc41817c1db4467d59f26abb Mon Sep 17 00:00:00 2001 From: Krad Date: Tue, 12 Oct 2021 10:55:51 +0800 Subject: [PATCH] Add edit accept signal to EditPatientForm. --- src/editpatientform.cpp | 5 +++++ src/editpatientform.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/editpatientform.cpp b/src/editpatientform.cpp index d8d99b4..0432145 100644 --- a/src/editpatientform.cpp +++ b/src/editpatientform.cpp @@ -29,6 +29,11 @@ EditPatientForm::EditPatientForm(QWidget *parent) : this->setEditEnable(false); restorePatientInformation(); }); + connect(btnEditAccept,&QToolButton::clicked,[=](){ + storePatientInformation(); + this->setEditEnable(false); + emit editAccept(getPatientInformation()); + }); } EditPatientForm::~EditPatientForm() diff --git a/src/editpatientform.h b/src/editpatientform.h index 1775a9c..44252b8 100644 --- a/src/editpatientform.h +++ b/src/editpatientform.h @@ -39,10 +39,15 @@ public: explicit EditPatientForm(QWidget *parent = nullptr); ~EditPatientForm(); void setPatientInformation(PatientInformation * information); + PatientInformation * getPatientInformation(){ + return &store; + } void clearPatientInformation(); void storePatientInformation(); void restorePatientInformation(); void setEditEnable(bool enable); + signals: + void editAccept(PatientInformation * detail); private: Ui::EditPatientForm *ui; QString currentPatientUID;