X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsubprojectitem.cpp;h=9c8ad1ef21303ad3f684689cca6c7c840d964f52;hb=d2c37081e19ccb5eef6d367f0feeb085b8ab7272;hp=02c4970514a8502890370d43cfb2daab5a4caeb5;hpb=fde1805d24a162938c4c9ec7f9e1f60292b94f37;p=kdenlive diff --git a/src/subprojectitem.cpp b/src/subprojectitem.cpp index 02c49705..9c8ad1ef 100644 --- a/src/subprojectitem.cpp +++ b/src/subprojectitem.cpp @@ -30,13 +30,14 @@ const int DurationRole = Qt::UserRole + 1; -SubProjectItem::SubProjectItem(QTreeWidgetItem * parent, int in, int out) : - QTreeWidgetItem(parent, PROJECTSUBCLIPTYPE), m_in(in), m_out(out) +SubProjectItem::SubProjectItem(QTreeWidgetItem * parent, int in, int out, QString description) : + QTreeWidgetItem(parent, PROJECTSUBCLIPTYPE), m_in(in), m_out(out), m_description(description) { setSizeHint(0, QSize(65, 30)); - setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable); + setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsDropEnabled); QString name = Timecode::getStringTimecode(in, KdenliveSettings::project_fps()); setText(0, name); + setText(1, description); GenTime duration = GenTime(out - in, KdenliveSettings::project_fps()); if (duration != GenTime()) setData(0, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps())); //setFlags(Qt::NoItemFlags); @@ -65,9 +66,28 @@ QPoint SubProjectItem::zone() const return z; } +void SubProjectItem::setZone(QPoint p) +{ + m_in = p.x(); + m_out = p.y(); + QString name = Timecode::getStringTimecode(m_in, KdenliveSettings::project_fps()); + setText(0, name); + GenTime duration = GenTime(m_out - m_in, KdenliveSettings::project_fps()); + if (duration != GenTime()) setData(0, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps())); +} + DocClipBase *SubProjectItem::referencedClip() { return NULL; //m_clip; } +QString SubProjectItem::description() const +{ + return m_description; +} +void SubProjectItem::setDescription(QString desc) +{ + m_description = desc; + setText(1, m_description); +}