Auto select first row of patient tableView.
This commit is contained in:
@@ -80,6 +80,7 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
table->setColumnWidth(2,250);
|
||||
table->setColumnWidth(3,120);
|
||||
table->setColumnWidth(4,60);
|
||||
|
||||
contentLayout->addWidget(table);
|
||||
QWidget* spacerLine2= new QWidget(this);
|
||||
spacerLine2->setFixedWidth(2);
|
||||
@@ -89,7 +90,18 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
EditPatientForm* edit_patient= new EditPatientForm(this);
|
||||
edit_patient->setObjectName("edit_patient");
|
||||
contentLayout->addWidget(edit_patient);
|
||||
|
||||
//select default row 0
|
||||
if (model->rowCount()>0)
|
||||
{
|
||||
table->selectRow(0);
|
||||
currentRow=0;
|
||||
PatientInformation pat;
|
||||
#define ADD_PATIENT_PROPERTY(val)\
|
||||
pat. val = model->data(model->index(currentRow,PatientInformationEnum:: val)).toString();
|
||||
EDIT_PATIENT()
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
edit_patient->setPatientInformation(&pat);
|
||||
}
|
||||
//events----------------------------------------------------------------------
|
||||
//table current row selection changing event
|
||||
connect(table,&QTableView::clicked,[=](const QModelIndex & modelIndex){
|
||||
|
||||
Reference in New Issue
Block a user