ctkErrorLogWidget.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  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 __ctkErrorLogWidget_h
  15. #define __ctkErrorLogWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. // CTK includes
  19. #include "ctkWidgetsExport.h"
  20. class ctkErrorLogModel;
  21. class ctkErrorLogWidgetPrivate;
  22. class QAbstractButton;
  23. class QItemSelection;
  24. class QModelIndex;
  25. /// \ingroup Widgets
  26. class CTK_WIDGETS_EXPORT ctkErrorLogWidget : public QWidget
  27. {
  28. Q_OBJECT
  29. public:
  30. typedef QWidget Superclass;
  31. explicit ctkErrorLogWidget(QWidget* parentWidget = 0);
  32. virtual ~ctkErrorLogWidget();
  33. ctkErrorLogModel* errorLogModel()const;
  34. Q_INVOKABLE void setErrorLogModel(ctkErrorLogModel * newErrorLogModel);
  35. /// Hide table column identified by /a columnId.
  36. /// \sa ctkErrorLogModel::ColumnsIds
  37. Q_INVOKABLE void setColumnHidden(int columnId, bool hidden) const;
  38. public Q_SLOTS:
  39. void setAllEntriesVisible(bool visibility = true);
  40. void setErrorEntriesVisible(bool visibility);
  41. void setWarningEntriesVisible(bool visibility);
  42. void setInfoEntriesVisible(bool visibility);
  43. void setUnknownEntriesVisible(bool visibility);
  44. protected Q_SLOTS:
  45. void onRowsInserted(const QModelIndex &parent, int first, int last);
  46. void onLogLevelFilterChanged();
  47. void removeEntries();
  48. void onSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
  49. protected:
  50. QScopedPointer<ctkErrorLogWidgetPrivate> d_ptr;
  51. private:
  52. Q_DECLARE_PRIVATE(ctkErrorLogWidget);
  53. Q_DISABLE_COPY(ctkErrorLogWidget);
  54. };
  55. #endif