15class Scene :
public QObject
18 Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged)
19 Q_PROPERTY (QColor color READ color WRITE setColor NOTIFY colorChanged)
27 arrangement::ArrangerObjectRegistry &object_registry,
29 QObject * parent =
nullptr)
32 utils::make_qobject_unique<
37 ClipSlotList * clipSlots ()
const {
return clip_slot_list_.get (); }
40 QString name ()
const {
return name_; }
41 void setName (
const QString &name);
42 Q_SIGNAL
void nameChanged (
const QString &name);
45 QColor color ()
const {
return color_; }
46 void setColor (
const QColor &color);
47 Q_SIGNAL
void colorChanged (
const QColor &color);
50 auto &clip_slots ()
const {
return clip_slot_list_->clip_slots (); }
67 ScenePtrRole = Qt::UserRole + 1,
72 Q_INVOKABLE
void removeScene (
int index);
73 Q_INVOKABLE
void moveScene (
int fromIndex,
int toIndex);
75 auto &scenes ()
const {
return scenes_; }
81 QHash<int, QByteArray> roleNames ()
const override
83 QHash<int, QByteArray> roles;
84 roles[ScenePtrRole] =
"scene";
87 int rowCount (
const QModelIndex &parent = QModelIndex ())
const override
89 if (parent.isValid ())
91 return static_cast<int> (scenes_.size ());
94 data (
const QModelIndex &index,
int role = Qt::DisplayRole)
const override
96 const auto index_int = index.row ();
97 if (!index.isValid () || index_int >=
static_cast<int> (scenes_.size ()))
100 if (role == ScenePtrRole)
102 return QVariant::fromValue (scenes_.at (index_int).get ());
110 std::vector<utils::QObjectUniquePtr<Scene>> scenes_;