pqAnimationWidget.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 
5 #ifndef pqAnimationWidget_h
6 #define pqAnimationWidget_h
7 
8 #include "pqWidgetsModule.h"
9 
10 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_12_0
11 
12 #include <QAbstractScrollArea>
13 #include <QStandardItemModel>
14 
15 class QGraphicsView;
16 class QHeaderView;
17 class pqAnimationModel;
18 class pqAnimationTrack;
19 
22  : public QAbstractScrollArea
23 {
24  Q_OBJECT;
25  using Superclass = QAbstractScrollArea;
26 
27 public:
28  pqAnimationWidget(QWidget* p = nullptr);
29  ~pqAnimationWidget() override = default;
30 
31  pqAnimationModel* animationModel() const;
32 
36  QHeaderView* enabledHeader() const;
37 
38  QHeaderView* createDeleteHeader() const;
39  QWidget* createDeleteWidget() const;
40 
41 Q_SIGNALS:
42  // emitted when a track is double clicked on
43  void trackSelected(pqAnimationTrack*);
44  void deleteTrackClicked(pqAnimationTrack*);
45  void createTrackClicked();
46  // emitted when the timeline offset is changed
47  void timelineOffsetChanged(int);
48 
52  void enableTrackClicked(pqAnimationTrack*);
53 
54 protected Q_SLOTS:
55  void updateSizes();
56  void headerDblClicked(int);
57  void headerDeleteClicked(int);
58  void headerEnabledClicked(int which);
59 
60 protected: // NOLINT(readability-redundant-access-specifiers)
61  void updateGeometries();
62  void updateScrollBars();
63  void updateWidgetPosition();
64  void scrollContentsBy(int dx, int dy) override;
65  bool event(QEvent* e) override;
66  void resizeEvent(QResizeEvent* e) override;
67  void showEvent(QShowEvent* e) override;
68  void wheelEvent(QWheelEvent* e) override;
69 
70 private:
71  QGraphicsView* View;
72  QHeaderView* CreateDeleteHeader;
73  QHeaderView* EnabledHeader;
74  QStandardItemModel CreateDeleteModel;
75  QHeaderView* Header;
76  QWidget* CreateDeleteWidget;
77  pqAnimationModel* Model;
78 };
79 
80 #endif // pqAnimationWidget_h
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
#define PQWIDGETS_EXPORT
pqTimeManagerWidget is the main widget for the Time Manager dock.