Browse Source

Moved private function to pimpl

Andreas Fetzer 11 years ago
parent
commit
9dd7354daa
2 changed files with 25 additions and 27 deletions
  1. 25 24
      Libs/DICOM/Widgets/ctkDICOMTableView.cpp
  2. 0 3
      Libs/DICOM/Widgets/ctkDICOMTableView.h

+ 25 - 24
Libs/DICOM/Widgets/ctkDICOMTableView.cpp

@@ -44,6 +44,8 @@ public:
   //Temporay solution to hide UID columns
   void hideUIDColumns();
 
+  QStringList getUIDsForAllRows();
+
   QSharedPointer<ctkDICOMDatabase> DICOMDatabase;
   QSqlQueryModel DICOMSQLModel;
   QSortFilterProxyModel* DICOMSQLFilterModel;
@@ -131,6 +133,27 @@ void ctkDICOMTableViewPrivate::hideUIDColumns()
   }
 }
 
+QStringList ctkDICOMTableViewPrivate::getUIDsForAllRows()
+{
+  QAbstractItemModel* tableModel = this->tblDicomDatabaseView->model();
+  int numberOfRows = tableModel->rowCount();
+  QStringList uids;
+  if (numberOfRows == 0)
+  {
+    //Return invalid UID if there are no rows
+    uids << QString("'#'");
+  }
+  else
+  {
+    for(int i = 0; i < numberOfRows; ++i)
+    {
+      uids << (QString("'") + tableModel->index(i,0).data().toString() +"'");
+    }
+  }
+  return uids;
+}
+
+
 //----------------------------------------------------------------------------
 // ctkDICOMTableView methods
 
@@ -215,7 +238,7 @@ void ctkDICOMTableView::onUpdateQuery(const QStringList& uids)
     query.append(uids.join(",")).append(");");
   }
   d->DICOMSQLModel.setQuery(query, d->DICOMDatabase->database());
-  QStringList newUIDS = this->getUIDsForAllRows();
+  QStringList newUIDS = d->getUIDsForAllRows();
   emit signalQueryChanged(newUIDS);
 }
 
@@ -223,28 +246,6 @@ void ctkDICOMTableView::onFilterChanged()
 {
   Q_D(ctkDICOMTableView);
 
-  QStringList uids = this->getUIDsForAllRows();
+  QStringList uids = d->getUIDsForAllRows();
   emit signalQueryChanged(uids);
 }
-
-QStringList ctkDICOMTableView::getUIDsForAllRows()
-{
-  Q_D(ctkDICOMTableView);
-  QAbstractItemModel* tableModel = d->tblDicomDatabaseView->model();
-  int numberOfRows = tableModel->rowCount();
-  QStringList uids;
-  if (numberOfRows == 0)
-  {
-    //Return invalid UID if there are no rows
-    uids << QString("'#'");
-  }
-  else
-  {
-    for(int i = 0; i < numberOfRows; ++i)
-    {
-      uids << (QString("'") + tableModel->index(i,0).data().toString() +"'");
-    }
-  }
-  return uids;
-}
-

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

@@ -129,9 +129,6 @@ Q_SIGNALS:
 protected:
   QScopedPointer<ctkDICOMTableViewPrivate> d_ptr;
 
-private:
-  QStringList getUIDsForAllRows();
-
   Q_DECLARE_PRIVATE(ctkDICOMTableView)
   Q_DISABLE_COPY(ctkDICOMTableView)
 };