소스 검색

Add an accessor to the internal QTableView

This is a way to gain access to tableview-specific functions,
such as header management
Jerome 9 년 전
부모
커밋
78ba911d87
2개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Libs/DICOM/Widgets/ctkDICOMTableView.cpp
  2. 8 0
      Libs/DICOM/Widgets/ctkDICOMTableView.h

+ 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:
 
   /**