pqTimelineModel.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 pqTimelineModel_h
5 #define pqTimelineModel_h
6 
8 
9 #include <QStandardItemModel>
10 
11 #include <memory> // for std::unique_ptr
12 
14 {
15 enum Role
16 {
17  TYPE = Qt::UserRole + 1,
23 };
24 };
25 
27 {
28 enum Column
29 {
30  NAME = 0,
34 };
35 };
36 
37 namespace pqTimelineTrack
38 {
40 {
41  NONE = 0,
46 };
47 };
48 
64 class PQAPPLICATIONCOMPONENTS_EXPORT pqTimelineModel : public QStandardItemModel
65 {
66  Q_OBJECT
67  typedef QStandardItemModel Superclass;
68 
69 public:
70  pqTimelineModel(QObject* parent = nullptr);
71  ~pqTimelineModel() override;
72 
84  QList<QStandardItem*> createRow(
85  pqTimelineTrack::TrackType type, const QString& name, QMap<int, QVariant> additionalData = {});
86 
90  void clearRows(pqTimelineTrack::TrackType type);
91 
95  void deleteRow(pqTimelineTrack::TrackType type, const QString& registrationName);
96 
100  bool setData(
101  const QModelIndex& index, const QVariant& value, int role = Qt::DisplayRole) override;
102 
106  void setRowEnabled(
108  pqTimelineTrack::TrackType type, bool enabled, const QString& name = QString());
109  bool isRowEnabled(pqTimelineTrack::TrackType type, const QString& name = QString());
110  void toggleRow(pqTimelineTrack::TrackType type, const QString& name);
111  void setRowsEnabled(pqTimelineTrack::TrackType type, bool enabled);
113 
117  QList<QList<QStandardItem*>> rows(pqTimelineTrack::TrackType type);
118 
122  QList<QList<QStandardItem*>> uncheckedRows(pqTimelineTrack::TrackType type);
123 
124 Q_SIGNALS:
125  void sourceStateChanged();
126  void animationStateChanged();
127 
128 private:
129  Q_DISABLE_COPY(pqTimelineModel)
130  struct pqInternals;
131  std::unique_ptr<pqInternals> Internals;
132 };
133 
134 #endif
type
#define PQAPPLICATIONCOMPONENTS_EXPORT
name
const int NONE
enabled
value
pqTimelineModel is a standard item model for ParaView timelines, intended to be used with pqTimelineV...
index