Explorar el Código

Add an accessor to the internal QTableView

This is a way to gain access to tableview-specific functions,
such as header management
Jerome hace 9 años
padre
commit
78ba911d87

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

@@ -419,3 +419,10 @@ void ctkDICOMTableView::onCustomContextMenuRequested(const QPoint &point)
 
 
   emit customContextMenuRequested(globalPosition);
   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"
 #include "ctkDICOMWidgetsExport.h"
 
 
 class ctkDICOMTableViewPrivate;
 class ctkDICOMTableViewPrivate;
+class QTableView;
 
 
 /**
 /**
  * @brief The ctkDICOMTableView displays the content of a specific table of the ctkDICOMDatabase
  * @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_OBJECT
   Q_PROPERTY(bool filterActive READ filterActive)
   Q_PROPERTY(bool filterActive READ filterActive)
+  Q_PROPERTY( QTableView* tblDicomDatabaseView READ tableView )
 
 
 public:
 public:
   typedef QWidget Superclass;
   typedef QWidget Superclass;
@@ -118,6 +120,12 @@ public:
   void setTableSectionSize(int);
   void setTableSectionSize(int);
   int tableSectionSize();
   int tableSectionSize();
 
 
+  /**
+  * @brief Get the actual QTableView, for specific view settings
+  * @return a pointer to QTableView* tblDicomDatabaseView
+  */
+  QTableView* tableView();
+
 public Q_SLOTS:
 public Q_SLOTS:
 
 
   /**
   /**