diff --git a/src/dialogs/GetWorkListDialog.cpp b/src/dialogs/GetWorkListDialog.cpp index c7d5605..2ecf0de 100644 --- a/src/dialogs/GetWorkListDialog.cpp +++ b/src/dialogs/GetWorkListDialog.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include "components/ULineEdit.h" #include "action/GetWorkListAction.h" @@ -20,15 +22,15 @@ GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTa , mPatientId(new ULineEdit(mContentWidget)) , mErrorLabel(new QLabel(mContentWidget)) , mAccessionNumText(new QLabel(mContentWidget)) - , mAccessionNumEndLine(new QLabel(mContentWidget)) , mPatientIDText(new QLabel(mContentWidget)) - , mPatientIDLine(new QLabel(mContentWidget)) + , mEditEndLine(new QLabel(mContentWidget)) , mPatientSelectTable(new QTableView(mContentWidget)) , mMode(PatientSearchMode) , mPatientSelectModel(new QStandardItemModel(mContentWidget)) , mSqlModel(aSqlModel) , mTableView(aTableView) , mSearchedPatients() + , mRadioButtonArea(new QWidget(mContentWidget)) { initializeContentWidgets(); GetWorkListAction* action = qobject_cast(getAction()); @@ -45,19 +47,50 @@ GetWorkListDialog::~GetWorkListDialog() void GetWorkListDialog::initializeContentWidgets() { QVBoxLayout* contentLayout = new QVBoxLayout(mContentWidget); + mRadioButtonArea->setObjectName("RadioButtonArea"); + contentLayout->addWidget(mRadioButtonArea); + QHBoxLayout* radioButtonLayout = new QHBoxLayout(mRadioButtonArea); + radioButtonLayout->setSpacing(50); + QRadioButton* radioButton1 = new QRadioButton(tr("Accession Number"), this); + radioButton1->setChecked(true); + QRadioButton* radioButton2 = new QRadioButton(tr("Patient ID"), this); + radioButtonLayout->addWidget(radioButton1); + radioButtonLayout->addWidget(radioButton2); + QButtonGroup* buttonGroup = new QButtonGroup(this); + buttonGroup->addButton(radioButton1, 0); + buttonGroup->addButton(radioButton2, 1); + connect(buttonGroup, QOverload::of(&QButtonGroup::buttonClicked), [this](int aButtonIndex) + { + mAccessionNumber->clear(); + mPatientId->clear(); + if(aButtonIndex == 0) + { + mPatientIDText->setVisible(false); + mPatientId->setVisible(false); + mAccessionNumText->setVisible(true); + mAccessionNumber->setVisible(true); + } + else + { + mAccessionNumText->setVisible(false); + mAccessionNumber->setVisible(false); + mPatientIDText->setVisible(true); + mPatientId->setVisible(true); + } + }); //Accession Nummber mAccessionNumText->setText(tr("Accession Nummber")); contentLayout->addWidget(mAccessionNumText); contentLayout->addWidget(mAccessionNumber); - mAccessionNumEndLine->setObjectName("endline"); - contentLayout->addWidget(mAccessionNumEndLine); //PatientId mPatientIDText->setText(tr("Patient ID")); contentLayout->addWidget(mPatientIDText); contentLayout->addWidget(mPatientId); - mPatientIDLine->setObjectName("endline"); - contentLayout->addWidget(mPatientIDLine); + mEditEndLine->setObjectName("endline"); + contentLayout->addWidget(mEditEndLine); + mPatientIDText->setVisible(false); + mPatientId->setVisible(false); //TableView contentLayout->addWidget(mPatientSelectTable); @@ -166,13 +199,13 @@ void GetWorkListDialog::showPatientSelectTable() QRect re = geometry(); setGeometry(re.x() - 200, re.y(), 900, re.height()); mMode = PatientSelectMode; + mRadioButtonArea->hide(); mAccessionNumber->hide(); mPatientId->hide(); mErrorLabel->hide(); mAccessionNumText->hide(); - mAccessionNumEndLine->hide(); mPatientIDText->hide(); - mPatientIDLine->hide(); + mEditEndLine->hide(); mPatientSelectTable->show(); mContentWidget->show(); diff --git a/src/dialogs/GetWorkListDialog.h b/src/dialogs/GetWorkListDialog.h index 5da5617..59549b4 100644 --- a/src/dialogs/GetWorkListDialog.h +++ b/src/dialogs/GetWorkListDialog.h @@ -38,15 +38,15 @@ private: ULineEdit* mPatientId; QLabel* mErrorLabel; QLabel* mAccessionNumText; - QLabel* mAccessionNumEndLine; QLabel* mPatientIDText; - QLabel* mPatientIDLine; + QLabel* mEditEndLine; QTableView* mPatientSelectTable; GetWorkListDialogMode mMode; QStandardItemModel* mPatientSelectModel; QSqlTableModel* mSqlModel; QTableView* mTableView; QList mSearchedPatients; + QWidget* mRadioButtonArea; }; diff --git a/src/icons/radio_check.png b/src/icons/radio_check.png new file mode 100644 index 0000000..65fae10 Binary files /dev/null and b/src/icons/radio_check.png differ diff --git a/src/icons/radio_uncheck.png b/src/icons/radio_uncheck.png new file mode 100644 index 0000000..6a643c4 Binary files /dev/null and b/src/icons/radio_uncheck.png differ diff --git a/src/res.qrc b/src/res.qrc index 80b4482..9fb4bc1 100644 --- a/src/res.qrc +++ b/src/res.qrc @@ -55,5 +55,7 @@ icons/drainage.png icons/trash.png icons/query.png + icons/radio_check.png + icons/radio_uncheck.png diff --git a/src/stylesheet/Dark2.css b/src/stylesheet/Dark2.css index 4181e0c..b885840 100644 --- a/src/stylesheet/Dark2.css +++ b/src/stylesheet/Dark2.css @@ -877,3 +877,21 @@ QLabel#MultyMessageDialogSucess { qproperty-pixmap: url(":/icons/dicom/echo_suc.png"); qproperty-scaledContents: true; } + +QRadioButton{ + font-size: 18px; + spacing:20px; +} + +QRadioButton::indicator::unchecked{ + image: url(":/icons/radio_uncheck.png"); +} + +QRadioButton::indicator::checked{ + image: url(":/icons/radio_check.png"); +} + +QWidget#RadioButtonArea +{ + border-bottom: 1px solid grey; +}