Browse Source

Added signal for filter changes and added property for active filter

Conflicts:
	Libs/DICOM/Widgets/ctkDICOMTableView.h
Andreas Fetzer 11 years ago
parent
commit
3eef7cbae6
2 changed files with 17 additions and 1 deletions
  1. 8 0
      Libs/DICOM/Widgets/ctkDICOMTableView.cpp
  2. 9 1
      Libs/DICOM/Widgets/ctkDICOMTableView.h

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

@@ -288,6 +288,7 @@ void ctkDICOMTableView::onFilterChanged()
 
   const QStringList uids = d->quotedUidsForAllRows();
   d->tblDicomDatabaseView->clearSelection();
+//  emit filterChanged(uids);
   emit queryChanged(uids);
 }
 
@@ -342,3 +343,10 @@ QStringList ctkDICOMTableView::currentSelection() const
 
   return  uids;
 }
+
+//------------------------------------------------------------------------------
+bool ctkDICOMTableView::filterActive()
+{
+  Q_D(ctkDICOMTableView);
+  return (d->leSearchBox->text().length() != 0);
+}

+ 9 - 1
Libs/DICOM/Widgets/ctkDICOMTableView.h

@@ -42,6 +42,7 @@ class ctkDICOMTableViewPrivate;
 class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableView : public QWidget
 {
   Q_OBJECT
+  Q_PROPERTY(bool filterActive READ filterActive)
 
 public:
   typedef QWidget Superclass;
@@ -106,6 +107,14 @@ public:
    */
   QStringList currentSelection() const;
 
+  /**
+   * @brief Getting the UIDs for all rows
+   * @return a QStringList with the uids for all rows
+   */
+  QStringList uidsForAllRows() const;
+
+  bool filterActive();
+
 public Q_SLOTS:
 
   /**
@@ -151,7 +160,6 @@ Q_SIGNALS:
 
   void doubleClicked(const QModelIndex&);
 
-
 protected:
   QScopedPointer<ctkDICOMTableViewPrivate> d_ptr;