Add radioButton in GetWorklistDialog .

This commit is contained in:
sunwen
2023-08-30 17:19:26 +08:00
parent a384950cd6
commit 20b4d1ce36
6 changed files with 63 additions and 10 deletions

View File

@@ -9,6 +9,8 @@
#include <QUuid> #include <QUuid>
#include <QDateTime> #include <QDateTime>
#include <QSqlRecord> #include <QSqlRecord>
#include <QRadioButton>
#include <QButtonGroup>
#include "components/ULineEdit.h" #include "components/ULineEdit.h"
#include "action/GetWorkListAction.h" #include "action/GetWorkListAction.h"
@@ -20,15 +22,15 @@ GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTa
, mPatientId(new ULineEdit(mContentWidget)) , mPatientId(new ULineEdit(mContentWidget))
, mErrorLabel(new QLabel(mContentWidget)) , mErrorLabel(new QLabel(mContentWidget))
, mAccessionNumText(new QLabel(mContentWidget)) , mAccessionNumText(new QLabel(mContentWidget))
, mAccessionNumEndLine(new QLabel(mContentWidget))
, mPatientIDText(new QLabel(mContentWidget)) , mPatientIDText(new QLabel(mContentWidget))
, mPatientIDLine(new QLabel(mContentWidget)) , mEditEndLine(new QLabel(mContentWidget))
, mPatientSelectTable(new QTableView(mContentWidget)) , mPatientSelectTable(new QTableView(mContentWidget))
, mMode(PatientSearchMode) , mMode(PatientSearchMode)
, mPatientSelectModel(new QStandardItemModel(mContentWidget)) , mPatientSelectModel(new QStandardItemModel(mContentWidget))
, mSqlModel(aSqlModel) , mSqlModel(aSqlModel)
, mTableView(aTableView) , mTableView(aTableView)
, mSearchedPatients() , mSearchedPatients()
, mRadioButtonArea(new QWidget(mContentWidget))
{ {
initializeContentWidgets(); initializeContentWidgets();
GetWorkListAction* action = qobject_cast<GetWorkListAction*>(getAction()); GetWorkListAction* action = qobject_cast<GetWorkListAction*>(getAction());
@@ -45,19 +47,50 @@ GetWorkListDialog::~GetWorkListDialog()
void GetWorkListDialog::initializeContentWidgets() void GetWorkListDialog::initializeContentWidgets()
{ {
QVBoxLayout* contentLayout = new QVBoxLayout(mContentWidget); 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<int>::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 //Accession Nummber
mAccessionNumText->setText(tr("Accession Nummber")); mAccessionNumText->setText(tr("Accession Nummber"));
contentLayout->addWidget(mAccessionNumText); contentLayout->addWidget(mAccessionNumText);
contentLayout->addWidget(mAccessionNumber); contentLayout->addWidget(mAccessionNumber);
mAccessionNumEndLine->setObjectName("endline");
contentLayout->addWidget(mAccessionNumEndLine);
//PatientId //PatientId
mPatientIDText->setText(tr("Patient ID")); mPatientIDText->setText(tr("Patient ID"));
contentLayout->addWidget(mPatientIDText); contentLayout->addWidget(mPatientIDText);
contentLayout->addWidget(mPatientId); contentLayout->addWidget(mPatientId);
mPatientIDLine->setObjectName("endline"); mEditEndLine->setObjectName("endline");
contentLayout->addWidget(mPatientIDLine); contentLayout->addWidget(mEditEndLine);
mPatientIDText->setVisible(false);
mPatientId->setVisible(false);
//TableView //TableView
contentLayout->addWidget(mPatientSelectTable); contentLayout->addWidget(mPatientSelectTable);
@@ -166,13 +199,13 @@ void GetWorkListDialog::showPatientSelectTable()
QRect re = geometry(); QRect re = geometry();
setGeometry(re.x() - 200, re.y(), 900, re.height()); setGeometry(re.x() - 200, re.y(), 900, re.height());
mMode = PatientSelectMode; mMode = PatientSelectMode;
mRadioButtonArea->hide();
mAccessionNumber->hide(); mAccessionNumber->hide();
mPatientId->hide(); mPatientId->hide();
mErrorLabel->hide(); mErrorLabel->hide();
mAccessionNumText->hide(); mAccessionNumText->hide();
mAccessionNumEndLine->hide();
mPatientIDText->hide(); mPatientIDText->hide();
mPatientIDLine->hide(); mEditEndLine->hide();
mPatientSelectTable->show(); mPatientSelectTable->show();
mContentWidget->show(); mContentWidget->show();

View File

@@ -38,15 +38,15 @@ private:
ULineEdit* mPatientId; ULineEdit* mPatientId;
QLabel* mErrorLabel; QLabel* mErrorLabel;
QLabel* mAccessionNumText; QLabel* mAccessionNumText;
QLabel* mAccessionNumEndLine;
QLabel* mPatientIDText; QLabel* mPatientIDText;
QLabel* mPatientIDLine; QLabel* mEditEndLine;
QTableView* mPatientSelectTable; QTableView* mPatientSelectTable;
GetWorkListDialogMode mMode; GetWorkListDialogMode mMode;
QStandardItemModel* mPatientSelectModel; QStandardItemModel* mPatientSelectModel;
QSqlTableModel* mSqlModel; QSqlTableModel* mSqlModel;
QTableView* mTableView; QTableView* mTableView;
QList<PatientInformationPointer> mSearchedPatients; QList<PatientInformationPointer> mSearchedPatients;
QWidget* mRadioButtonArea;
}; };

BIN
src/icons/radio_check.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
src/icons/radio_uncheck.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@@ -55,5 +55,7 @@
<file>icons/drainage.png</file> <file>icons/drainage.png</file>
<file>icons/trash.png</file> <file>icons/trash.png</file>
<file>icons/query.png</file> <file>icons/query.png</file>
<file>icons/radio_check.png</file>
<file>icons/radio_uncheck.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -877,3 +877,21 @@ QLabel#MultyMessageDialogSucess {
qproperty-pixmap: url(":/icons/dicom/echo_suc.png"); qproperty-pixmap: url(":/icons/dicom/echo_suc.png");
qproperty-scaledContents: true; 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;
}