Add new UI logic for ScanFormWidget, which is mainly about button enable and disable in different mode.
This commit is contained in:
@@ -99,12 +99,34 @@ ScanFormWidget::ScanFormWidget(QWidget *parent) : TabFormWidget(parent) {
|
||||
contentLayout->addWidget(param_widget);
|
||||
pat_inf = patient_information;
|
||||
|
||||
btnScan->setEnabled(false);
|
||||
btnRefresh->setEnabled(false);
|
||||
btnPreview->setEnabled(false);
|
||||
btnStop->setEnabled(false);
|
||||
|
||||
|
||||
//Events---------------------------------------------------------------
|
||||
connect(EventCenter::Default(),&EventCenter::PatientSelected,[=](QObject* sender,QObject* data){
|
||||
if(unset)
|
||||
{
|
||||
btnScan->setEnabled(true);
|
||||
btnRefresh->setEnabled(true);
|
||||
btnPreview->setEnabled(true);
|
||||
btnStop->setEnabled(true);
|
||||
unset = false;
|
||||
}
|
||||
patient_information->setPatientInformation((PatientInformation*)data);
|
||||
});
|
||||
|
||||
connect(group, SIGNAL(buttonClicked(int)),this,SLOT(protocolChanged(int)));
|
||||
|
||||
previewfunc = [=](bool val)->void{
|
||||
btnPreview->setCheckable(val);
|
||||
btnPreview->setChecked(val);
|
||||
btnPreview->setEnabled(!val);
|
||||
btnRefresh->setEnabled(!val);
|
||||
btnScan->setEnabled(!val);
|
||||
};
|
||||
}
|
||||
|
||||
ScanFormWidget::~ScanFormWidget() {
|
||||
@@ -115,3 +137,9 @@ void ScanFormWidget::protocolChanged(int type) {
|
||||
printf("%d\r\n",type);
|
||||
pat_inf->setProtocol(type);
|
||||
}
|
||||
|
||||
void ScanFormWidget::setPreviewing(bool val) {
|
||||
if(previewfunc) previewfunc(val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user