Переглянути джерело

Merge pull request #640 from jeromevelut/expose-dicom-tableviews

Expose dicom tableviews
Jean-Christophe Fillion-Robin 9 роки тому
батько
коміт
4160c48bf1

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

@@ -329,3 +329,22 @@ ctkDICOMTableManager::DisplayDensity ctkDICOMTableManager::displayDensity()
     return ctkDICOMTableManager::Compact;
   }
 }
+
+//------------------------------------------------------------------------------
+ctkDICOMTableView* ctkDICOMTableManager::patientsTable()
+{
+  Q_D( ctkDICOMTableManager );
+  return(d->patientsTable);
+}
+//------------------------------------------------------------------------------
+ctkDICOMTableView* ctkDICOMTableManager::studiesTable()
+{
+  Q_D( ctkDICOMTableManager );
+  return(d->studiesTable);
+}
+//------------------------------------------------------------------------------
+ctkDICOMTableView* ctkDICOMTableManager::seriesTable()
+{
+  Q_D( ctkDICOMTableManager );
+  return(d->seriesTable);
+}

+ 13 - 1
Libs/DICOM/Widgets/ctkDICOMTableManager.h

@@ -30,7 +30,7 @@
 
 class ctkDICOMTableManagerPrivate;
 class ctkDICOMDatabase;
-
+class ctkDICOMTableView;
 class QItemSelection;
 class QModelIndex;
 
@@ -50,6 +50,13 @@ class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableManager : public QWidget
     */
   Q_PROPERTY(bool dynamicTableLayout READ dynamicTableLayout WRITE setDynamicTableLayout)
 
+  /**
+  * Properties for the different table views (patients, studies, series). 
+  */
+  Q_PROPERTY( ctkDICOMTableView* patientsTable READ patientsTable )
+  Q_PROPERTY( ctkDICOMTableView* studiesTable READ studiesTable )
+  Q_PROPERTY( ctkDICOMTableView* seriesTable READ seriesTable )
+
   Q_ENUMS(DisplayDensity)
   /**
   * This property holds the density of tables in the table Manager. There are three denisity
@@ -97,6 +104,11 @@ public:
   DisplayDensity displayDensity();
   void setDisplayDensity(DisplayDensity density);
 
+  ctkDICOMTableView* patientsTable();
+  ctkDICOMTableView* studiesTable();
+  ctkDICOMTableView* seriesTable();
+
+
 public Q_SLOTS:
 
   void onPatientsQueryChanged(const QStringList&);

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

@@ -419,3 +419,10 @@ void ctkDICOMTableView::onCustomContextMenuRequested(const QPoint &point)
 
   emit customContextMenuRequested(globalPosition);
 }
+
+//------------------------------------------------------------------------------
+QTableView* ctkDICOMTableView::tableView()
+{
+  Q_D( ctkDICOMTableView );
+  return(d->tblDicomDatabaseView);
+}

+ 8 - 0
Libs/DICOM/Widgets/ctkDICOMTableView.h

@@ -30,6 +30,7 @@
 #include "ctkDICOMWidgetsExport.h"
 
 class ctkDICOMTableViewPrivate;
+class QTableView;
 
 /**
  * @brief The ctkDICOMTableView displays the content of a specific table of the ctkDICOMDatabase
@@ -43,6 +44,7 @@ class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableView : public QWidget
 {
   Q_OBJECT
   Q_PROPERTY(bool filterActive READ filterActive)
+  Q_PROPERTY( QTableView* tblDicomDatabaseView READ tableView )
 
 public:
   typedef QWidget Superclass;
@@ -118,6 +120,12 @@ public:
   void setTableSectionSize(int);
   int tableSectionSize();
 
+  /**
+  * @brief Get the actual QTableView, for specific view settings
+  * @return a pointer to QTableView* tblDicomDatabaseView
+  */
+  QTableView* tableView();
+
 public Q_SLOTS:
 
   /**