Anyone can teach me how to implement the get and set method in qt ?
//HEADER FILE
public:
explicit PatientGui
(QWidget *parent
= 0);
~PatientGui();
//CPP FILE
{
return ID;
}
void PatientGui
::setID(const QString &value
) {
ID = ui->nric->text();
}
//IN THE NEXT GUII WANT TO PASS DATA TO
ui->Patientidentifier->setText(getID());
//HEADER FILE
public:
explicit PatientGui(QWidget *parent = 0);
~PatientGui();
QString ID;
QString getID() const;
void setID(const QString &value);
//CPP FILE
QString PatientGui::getID() const
{
return ID;
}
void PatientGui::setID(const QString &value)
{
ID = ui->nric->text();
}
//IN THE NEXT GUII WANT TO PASS DATA TO
ui->Patientidentifier->setText(getID());
To copy to clipboard, switch view to plain text mode
I gotten this error"error: undefined reference to `Infusion::getID()'"
Can anyone tell me what I did wrong ? I think the way i do iot is wrong , please teach me how to implement it correctly
Bookmarks