ctkDirectoryListWidget.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) University College London.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkDirectoryListWidget_h
  15. #define __ctkDirectoryListWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. #include <QStringList>
  19. // QtGUI includes
  20. #include "ctkWidgetsExport.h"
  21. class ctkDirectoryListWidgetPrivate;
  22. /**
  23. * \class ctkDirectoryListWidget
  24. * \brief A widget to maintain a list of directories, with add and remove buttons,
  25. * such as might be used in a settings panel to select a series of directories to search.
  26. *
  27. * \author m.clarkson@ucl.ac.uk
  28. */
  29. class CTK_WIDGETS_EXPORT ctkDirectoryListWidget : public QWidget
  30. {
  31. Q_OBJECT
  32. Q_PROPERTY(QStringList directoryList READ directoryList WRITE setDirectoryList)
  33. public:
  34. /// Superclass typedef
  35. typedef QWidget Superclass;
  36. ctkDirectoryListWidget(QWidget* parent = 0);
  37. virtual ~ctkDirectoryListWidget();
  38. /// Set the directory list, which will overwrite any existing list.
  39. void setDirectoryList(const QStringList& list);
  40. QStringList directoryList() const;
  41. public Q_SLOTS:
  42. Q_SIGNALS:
  43. /// directoryListChanged emmitted whenever the list of directories is changed.
  44. void directoryListChanged(const QStringList& directories);
  45. protected:
  46. QScopedPointer<ctkDirectoryListWidgetPrivate> d_ptr;
  47. private:
  48. Q_DECLARE_PRIVATE(ctkDirectoryListWidget)
  49. Q_DISABLE_COPY(ctkDirectoryListWidget)
  50. };
  51. #endif