Parcourir la source

Signal for selection of patient tableview is now propagated

Andreas Fetzer il y a 12 ans
Parent
commit
efae5d341b

+ 8 - 1
Libs/DICOM/Widgets/ctkDICOMTableManager.cpp

@@ -78,18 +78,25 @@ void ctkDICOMTableManagerPrivate::init()
   this->seriesTable = new ctkDICOMTableView(q, "Series");
   this->seriesTable->setQueryForeignKey("StudyInstanceUID");
 
+  //Connect changed tableview selection with query update of "child" table
   QObject::connect(this->patientsTable, SIGNAL(signalSelectionChanged(QStringList)),
                    this->studiesTable, SLOT(onUpdateQuery(QStringList)));
   QObject::connect(this->studiesTable, SIGNAL(signalSelectionChanged(QStringList)),
                    this->seriesTable, SLOT(onUpdateQuery(QStringList)));
+
+  //Connect changed filter with query update of "child" table
   QObject::connect(this->patientsTable, SIGNAL(signalFilterChanged(const QStringList&)),
                    this->studiesTable, SLOT(onUpdateQuery(const QStringList&)));
   QObject::connect(this->studiesTable, SIGNAL(signalFilterChanged(const QStringList&)),
                    this->seriesTable, SLOT(onUpdateQuery(const QStringList&)));
+  //This way a patient filter change can be propageted to series table without
+  //any selection in the study table
   QObject::connect(this->studiesTable, SIGNAL(signalQueryChanged(QStringList)),
                    this->seriesTable, SLOT(onUpdateQuery(const QStringList&)));
 
-  //TODO Set the right sizepolicy
+  QObject::connect(this->patientsTable, SIGNAL(signalSelectionChanged(const QItemSelection&, const QItemSelection&)),
+                   q, SIGNAL(signalPatientsSelectionChanged(const QItemSelection&, const QItemSelection&)));
+
   this->patientsTable->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
   this->studiesTable->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
   this->seriesTable->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);

+ 5 - 0
Libs/DICOM/Widgets/ctkDICOMTableManager.h

@@ -32,6 +32,8 @@
 class ctkDICOMTableManagerPrivate;
 class ctkDICOMDatabase;
 
+class QItemSelection;
+
 /// \ingroup DICOM_Widgets
 
 class ctkDICOMTableManager : public QWidget
@@ -47,6 +49,9 @@ public:
 
   void setCTKDICOMDatabase(QSharedPointer<ctkDICOMDatabase> db);
 
+Q_SIGNALS:
+  void signalPatientsSelectionChanged(const QItemSelection&, const QItemSelection&);
+
 protected:
   QScopedPointer<ctkDICOMTableManagerPrivate> d_ptr;