ctkPathListButtonsWidget_p.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 __ctkPathListButtonsWidget_p_h
  15. #define __ctkPathListButtonsWidget_p_h
  16. // Qt includes
  17. #include <QObject>
  18. // CTK includes
  19. #include "ui_ctkPathListButtonsWidget.h"
  20. class ctkPathListButtonsWidget;
  21. class ctkPathListWidget;
  22. class QFileDialog;
  23. //-----------------------------------------------------------------------------
  24. class ctkPathListButtonsWidgetPrivate : public QObject, public Ui_ctkPathListButtonsWidget
  25. {
  26. Q_OBJECT
  27. Q_DECLARE_PUBLIC(ctkPathListButtonsWidget)
  28. protected:
  29. ctkPathListButtonsWidget* const q_ptr;
  30. public:
  31. explicit ctkPathListButtonsWidgetPrivate(ctkPathListButtonsWidget& object);
  32. virtual ~ctkPathListButtonsWidgetPrivate();
  33. void init();
  34. void setupUi(QWidget * parent);
  35. public Q_SLOTS:
  36. void on_AddFilesButton_clicked();
  37. void on_AddDirButton_clicked();
  38. void on_RemoveButton_clicked();
  39. void on_EditButton_clicked();
  40. void on_PathListWidget_selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
  41. public:
  42. ctkPathListWidget* PathListWidget;
  43. private:
  44. QStringList openAddFilesDialog(bool multiple = true);
  45. QStringList openAddDirDialog();
  46. void addPathsWithWarningMessage(const QStringList& paths);
  47. };
  48. #endif