Browse Source

WIP set sql conditions just using onQueryChanged signals

Andreas Fetzer 11 years ago
parent
commit
275ab46b0f

+ 16 - 0
Libs/DICOM/Widgets/Resources/UI/ctkDICOMTableManager.ui

@@ -52,6 +52,22 @@ QSplitter::handle:vertical {height: 2px;}</string>
  </customwidgets>
  <resources/>
  <connections>
+ <connection>
+   <sender>patientsTable</sender>
+   <signal>queryChanged(QStringList)</signal>
+   <receiver>ctkDICOMTableManager</receiver>
+   <slot>onPatientsQueryChanged(QStringList)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>220</x>
+     <y>186</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>343</x>
+     <y>166</y>
+    </hint>
+   </hints>
+  </connection>
   <connection>
    <sender>patientsTable</sender>
    <signal>queryChanged(QStringList)</signal>

+ 18 - 0
Libs/DICOM/Widgets/ctkDICOMTableManager.cpp

@@ -74,6 +74,9 @@ void ctkDICOMTableManagerPrivate::init()
   this->seriesTable->setQueryTableName("Series");
   this->seriesTable->setQueryForeignKey("StudyInstanceUID");
 
+//  QObject::connect(this->patientsTable, SIGNAL(queryChanged(const QStringList&)),
+//                   q, SLOT(onPatientsQueryChanged(const QStringList&)));
+
   // For propagating patient selection changes
   QObject::connect(this->patientsTable, SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
                    q, SIGNAL(patientsSelectionChanged(const QItemSelection&, const QItemSelection&)));
@@ -180,3 +183,18 @@ QStringList ctkDICOMTableManager::currentSeriesSelection()
   Q_D(ctkDICOMTableManager);
   return d->seriesTable->currentSelection();
 }
+
+void ctkDICOMTableManager::onPatientsQueryChanged(const QStringList &uids)
+{
+  qDebug()<<"###PatientQUERY";
+}
+
+void ctkDICOMTableManager::onStudiesQueryChanged(const QStringList &uids)
+{
+
+}
+
+void ctkDICOMTableManager::onSeriesQueryChanged(const QStringList &uids)
+{
+
+}

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

@@ -69,6 +69,12 @@ public:
   QStringList currentStudiesSelection();
   QStringList currentSeriesSelection();
 
+public Q_SLOTS:
+
+  void onPatientsQueryChanged(const QStringList&);
+  void onStudiesQueryChanged(const QStringList&);
+  void onSeriesQueryChanged(const QStringList&);
+
 Q_SIGNALS:
   /// Signals for propagating selection changes of the different tables
   void patientsSelectionChanged(const QItemSelection&, const QItemSelection&);

+ 2 - 0
Libs/DICOM/Widgets/ctkDICOMTableView.cpp

@@ -287,12 +287,14 @@ void ctkDICOMTableView::onFilterChanged()
   Q_D(ctkDICOMTableView);
 
   const QStringList uids = d->quotedUidsForAllRows();
+  d->tblDicomDatabaseView->clearSelection();
   emit queryChanged(uids);
 }
 
 //------------------------------------------------------------------------------
 void ctkDICOMTableView::setQuery(const QStringList &uids)
 {
+  qDebug()<<"###PatientSEtQUERY";
   Q_D(ctkDICOMTableView);
   QString query = ("select distinct %1.* from Patients, Series, Studies where "
                    "Patients.UID = Studies.PatientsUID and Studies.StudyInstanceUID = Series.StudyInstanceUID");