ctkCmdLineModuleExplorerProgressWidget.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCMDLINEMODULEEXPLORERPROGRESSWIDGET_H
  16. #define CTKCMDLINEMODULEEXPLORERPROGRESSWIDGET_H
  17. #include "ctkCmdLineModuleResult.h"
  18. #include "ctkCmdLineModuleFutureWatcher.h"
  19. #include <QWidget>
  20. #include <QFutureWatcher>
  21. #include <QTimer>
  22. class ctkCmdLineModuleFuture;
  23. namespace Ui {
  24. class ctkCmdLineModuleExplorerProgressWidget;
  25. }
  26. /**
  27. * \class ctkCmdLineModuleExplorerProgressWidget
  28. * \brief Example application progress update widget.
  29. */
  30. class ctkCmdLineModuleExplorerProgressWidget : public QWidget
  31. {
  32. Q_OBJECT
  33. public:
  34. ctkCmdLineModuleExplorerProgressWidget(QWidget *parent = 0);
  35. ~ctkCmdLineModuleExplorerProgressWidget();
  36. void setFuture(const ctkCmdLineModuleFuture& future);
  37. void setTitle(const QString& title);
  38. void setHighlightStyle(bool highlight);
  39. private Q_SLOTS:
  40. void on_PauseButton_toggled(bool toggled);
  41. void on_RemoveButton_clicked();
  42. void checkModulePaused();
  43. void moduleStarted();
  44. void moduleCanceled();
  45. void moduleFinished();
  46. void moduleResumed();
  47. void moduleProgressRangeChanged(int progressMin, int progressMax);
  48. void moduleProgressTextChanged(const QString& progressText);
  49. void moduleProgressValueChanged(int progressValue);
  50. private:
  51. Ui::ctkCmdLineModuleExplorerProgressWidget *ui;
  52. ctkCmdLineModuleFutureWatcher FutureWatcher;
  53. QTimer PollPauseTimer;
  54. };
  55. #endif // CTKCMDLINEMODULEEXPLORERPROGRESSWIDGET_H