pqTimelineItemDelegate.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqTimelineItemDelegate_h
5 #define pqTimelineItemDelegate_h
6 
8 
9 #include <QStyledItemDelegate>
10 
11 #include <memory> // for std::unique_ptr
12 
13 class pqAnimationScene;
14 
15 class pqTimelinePainter;
16 
25 class PQAPPLICATIONCOMPONENTS_EXPORT pqTimelineItemDelegate : public QStyledItemDelegate
26 {
27  Q_OBJECT
28  typedef QStyledItemDelegate Superclass;
29 
30 public:
31  pqTimelineItemDelegate(QObject* parent = nullptr, QWidget* parentWidget = nullptr);
32  ~pqTimelineItemDelegate() override;
33 
38  void paint(
39  QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
40 
44  QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
45 
50  bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option,
51  const QModelIndex& index) override;
52 
61  bool eventFilter(QObject* watched, QEvent* event) override;
62 
63 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
67  void setActiveSceneConnections(pqAnimationScene* scene);
68 
72  void updateSceneTimeRange();
73 
74 Q_SIGNALS:
75  void needsRepaint();
76 
77 protected:
78  double Zoom = 1.;
79 
80 private:
81  struct pqInternals;
82  std::unique_ptr<pqInternals> Internals;
83 
84  std::unique_ptr<pqTimelinePainter> TimelinePainter;
85 };
86 
87 #endif
#define PQAPPLICATIONCOMPONENTS_EXPORT
pqTimelineItemDelegate draws timeline in cells and add some associated widgets.
pqTimelineItemDelegate draws timeline in cells.
index
pqAnimationScene is a representation for a vtkSMAnimationScene proxy.