Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
30class QDragEnterEvent;
31class QDropEvent;
32class qSlicerDirectoryListViewPrivate;
33
34class Q_SLICER_BASE_QTGUI_EXPORT qSlicerDirectoryListView : public QWidget
35{
36 Q_OBJECT
37 Q_PROPERTY(QStringList directoryList READ directoryList WRITE setDirectoryList NOTIFY directoryListChanged);
38public:
40 typedef QWidget Superclass;
41
43 explicit qSlicerDirectoryListView(QWidget* parent = nullptr);
44
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) override;
56 void dropEvent(QDropEvent *event) override;
57
58public slots:
59
62 void addDirectory(const QString& path);
63
68 void setDirectoryList(const QStringList& paths);
69
73 void removeDirectory(const QString& path);
74
77
80
83
84signals:
87
88protected:
89 QScopedPointer<qSlicerDirectoryListViewPrivate> d_ptr;
90
91private:
92 Q_DECLARE_PRIVATE(qSlicerDirectoryListView);
93 Q_DISABLE_COPY(qSlicerDirectoryListView);
94
95};
96
97#endif
void dragEnterEvent(QDragEnterEvent *event) override
void addDirectory(const QString &path)
QStringList directoryList(bool absolutePath=false) const
QWidget Superclass
Superclass typedef.
void selectAllDirectories()
Select all directories.
QScopedPointer< qSlicerDirectoryListViewPrivate > d_ptr
void removeDirectory(const QString &path)
QStringList selectedDirectoryList(bool absolutePath=false) const
void dropEvent(QDropEvent *event) override
void clearDirectorySelection()
Clear the current directory selection.
~qSlicerDirectoryListView() override
Destructor.
bool hasDirectory(const QString &path) const
Return True if the path has already been added.
qSlicerDirectoryListView(QWidget *parent=nullptr)
Constructor.
void directoryListChanged()
This signal is emitted when a directory is added to the view.
void setDirectoryList(const QStringList &paths)