Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerDirectoryListView.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerDirectoryListView_h
22 #define __qSlicerDirectoryListView_h
23 
24 // Qt includes
25 #include <QWidget>
26 
27 // QtGUI includes
28 #include "qSlicerBaseQTGUIExport.h"
29 
30 class QDragEnterEvent;
31 class QDropEvent;
32 class qSlicerDirectoryListViewPrivate;
33 
34 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerDirectoryListView : public QWidget
35 {
36  Q_OBJECT
37  Q_PROPERTY(QStringList directoryList READ directoryList WRITE setDirectoryList NOTIFY directoryListChanged);
38 public:
40  typedef QWidget Superclass;
41 
43  explicit qSlicerDirectoryListView(QWidget* parent = 0);
44 
46  virtual ~qSlicerDirectoryListView();
47 
49  bool hasDirectory(const QString& path)const;
50 
51  QStringList directoryList(bool absolutePath = false)const;
52 
53  QStringList selectedDirectoryList(bool absolutePath = false)const;
54 
55  void dragEnterEvent(QDragEnterEvent *event);
56  virtual void dropEvent(QDropEvent *event);
57 
58 public slots:
59 
62  void addDirectory(const QString& path);
63 
68  void setDirectoryList(const QStringList& paths);
69 
73  void removeDirectory(const QString& path);
74 
76  void removeSelectedDirectories();
77 
79  void selectAllDirectories();
80 
82  void clearDirectorySelection();
83 
84 signals:
86  void directoryListChanged();
87 
88 protected:
89  QScopedPointer<qSlicerDirectoryListViewPrivate> d_ptr;
90 
91 private:
92  Q_DECLARE_PRIVATE(qSlicerDirectoryListView);
93  Q_DISABLE_COPY(qSlicerDirectoryListView);
94 
95 };
96 
97 #endif
98 
QScopedPointer< qSlicerDirectoryListViewPrivate > d_ptr
QWidget Superclass
Superclass typedef.