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