feat: Update worklist table when worklist table showed.
This commit is contained in:
@@ -132,6 +132,7 @@ SelectFormWidget::SelectFormWidget(QWidget* parent)
|
|||||||
|
|
||||||
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::ScanProcessSequenceFinished, this, &SelectFormWidget::clearSelectedPatient);
|
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::ScanProcessSequenceFinished, this, &SelectFormWidget::clearSelectedPatient);
|
||||||
connect(mGetWorklistAction, &AsyncAction::actionCompleted, this, &SelectFormWidget::processWorklistSearchResult);
|
connect(mGetWorklistAction, &AsyncAction::actionCompleted, this, &SelectFormWidget::processWorklistSearchResult);
|
||||||
|
connect(mWorklistPatTable, &WorklistTableView::worklistTableViewShowed, this, &SelectFormWidget::pullPatient, Qt::QueuedConnection);
|
||||||
|
|
||||||
//first prepare buttons!
|
//first prepare buttons!
|
||||||
prepareButtons(false);
|
prepareButtons(false);
|
||||||
@@ -348,8 +349,12 @@ void SelectFormWidget::initDataModel() {
|
|||||||
mLocalPatientModel->setHeaderData(6, Qt::Horizontal, tr("Comment"));
|
mLocalPatientModel->setHeaderData(6, Qt::Horizontal, tr("Comment"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectFormWidget::setPatientDetail(const SlideTableView *table, const QSqlTableModel *model,
|
void SelectFormWidget::setPatientDetail(const SlideTableView *table, const QSqlTableModel *model, PatientDetailForm *edit_patient) const
|
||||||
PatientDetailForm *edit_patient) const {
|
{
|
||||||
|
if(model->rowCount() == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
PatientInformation pat;
|
PatientInformation pat;
|
||||||
#define ADD_PATIENT_PROPERTY(val)\
|
#define ADD_PATIENT_PROPERTY(val)\
|
||||||
pat. val = model->data(model->index(table->currentIndex().row(),PatientInformationEnum:: val),Qt::EditRole).toString();
|
pat. val = model->data(model->index(table->currentIndex().row(),PatientInformationEnum:: val),Qt::EditRole).toString();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class QTabWidget;
|
|||||||
class QTreeView;
|
class QTreeView;
|
||||||
class WorklistTableModel;
|
class WorklistTableModel;
|
||||||
class WorklistTableSelectModel;
|
class WorklistTableSelectModel;
|
||||||
|
class WorklistTableView;
|
||||||
class AsyncAction;
|
class AsyncAction;
|
||||||
|
|
||||||
class SelectFormWidget : public TabFormWidget {
|
class SelectFormWidget : public TabFormWidget {
|
||||||
@@ -52,7 +53,7 @@ private:
|
|||||||
QToolButton *mBtnAdd;
|
QToolButton *mBtnAdd;
|
||||||
QToolButton* mBtnPull;
|
QToolButton* mBtnPull;
|
||||||
QToolButton *mBtnSelect;
|
QToolButton *mBtnSelect;
|
||||||
QTreeView* mWorklistPatTable;
|
WorklistTableView* mWorklistPatTable;
|
||||||
WorklistTableModel* mWorklistTableModel;
|
WorklistTableModel* mWorklistTableModel;
|
||||||
WorklistTableSelectModel* mWorklistTableSelectModel;
|
WorklistTableSelectModel* mWorklistTableSelectModel;
|
||||||
SlideTableView *mLocalPatTable;
|
SlideTableView *mLocalPatTable;
|
||||||
|
|||||||
@@ -109,8 +109,6 @@ void WorklistTableView::mouseMoveEvent(QMouseEvent* aEvent)
|
|||||||
{
|
{
|
||||||
int nv = (int) round(((double) mOriginScrollBarV * ROW_HEIGHT + ((double) (mOriginPosY - aEvent->pos().y())))
|
int nv = (int) round(((double) mOriginScrollBarV * ROW_HEIGHT + ((double) (mOriginPosY - aEvent->pos().y())))
|
||||||
/ ROW_HEIGHT);
|
/ ROW_HEIGHT);
|
||||||
// int nv = mOriginScrollBarV * ROW_HEIGHT + ( (mOriginPosY - aEvent->pos().y()))
|
|
||||||
// / ROW_HEIGHT;
|
|
||||||
int max = this->verticalScrollBar()->maximum();
|
int max = this->verticalScrollBar()->maximum();
|
||||||
int min = this->verticalScrollBar()->minimum();
|
int min = this->verticalScrollBar()->minimum();
|
||||||
nv = nv > max ? max : (nv < min ? min : nv);
|
nv = nv > max ? max : (nv < min ? min : nv);
|
||||||
@@ -131,3 +129,9 @@ void WorklistTableView::mouseDoubleClickEvent(QMouseEvent* aEvent)
|
|||||||
}
|
}
|
||||||
aEvent->ignore();
|
aEvent->ignore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorklistTableView::showEvent(QShowEvent *aEvent)
|
||||||
|
{
|
||||||
|
emit worklistTableViewShowed();
|
||||||
|
return QTreeView::showEvent(aEvent);
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,10 +15,14 @@ protected:
|
|||||||
void mouseReleaseEvent(QMouseEvent *aEvent) override;
|
void mouseReleaseEvent(QMouseEvent *aEvent) override;
|
||||||
void mouseDoubleClickEvent(QMouseEvent* aEvent) override;
|
void mouseDoubleClickEvent(QMouseEvent* aEvent) override;
|
||||||
void mouseMoveEvent(QMouseEvent* aEvent) override;
|
void mouseMoveEvent(QMouseEvent* aEvent) override;
|
||||||
|
void showEvent(QShowEvent *aEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void singleClickExpand(const QModelIndex& aIndex);
|
void singleClickExpand(const QModelIndex& aIndex);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void worklistTableViewShowed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mOriginPosY;
|
int mOriginPosY;
|
||||||
int mOriginScrollBarV;
|
int mOriginScrollBarV;
|
||||||
|
|||||||
Reference in New Issue
Block a user