X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsubprojectitem.cpp;h=9c8ad1ef21303ad3f684689cca6c7c840d964f52;hb=672e4b17670b666350d820ce6fb30e40a862cbc3;hp=110ceca75b463174641a1b6f8bc92a52bb821150;hpb=880efc8572a7df65453dfb5736de6455fe129a86;p=kdenlive diff --git a/src/subprojectitem.cpp b/src/subprojectitem.cpp index 110ceca7..9c8ad1ef 100644 --- a/src/subprojectitem.cpp +++ b/src/subprojectitem.cpp @@ -20,6 +20,7 @@ #include "subprojectitem.h" #include "timecode.h" +#include "definitions.h" #include "kdenlivesettings.h" #include "docclipbase.h" @@ -29,15 +30,16 @@ const int DurationRole = Qt::UserRole + 1; -SubProjectItem::SubProjectItem(QTreeWidgetItem * parent, int in, int out) : - QTreeWidgetItem(parent, QTreeWidgetItem::UserType + 1), 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(1, name); + setText(0, name); + setText(1, description); GenTime duration = GenTime(out - in, KdenliveSettings::project_fps()); - if (duration != GenTime()) setData(1, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps())); + if (duration != GenTime()) setData(0, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps())); //setFlags(Qt::NoItemFlags); //kDebug() << "Constructed with clipId: " << m_clipId; } @@ -64,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); +}