-const int NameRole = Qt::UserRole;
-const int DurationRole = NameRole + 1;
-const int UsageRole = NameRole + 2;
-
-
-ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, QDomElement xml, int clipId)
- : QTreeWidgetItem(parent, strings, QTreeWidgetItem::UserType), m_clipType(UNKNOWN), m_clipId(clipId) {
- QDomElement element = xml.cloneNode().toElement();
- setSizeHint(0, QSize(65, 45));
- setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
- if (!element.isNull()) {
- element.setAttribute("id", clipId);
- QString cType = element.attribute("type", QString::null);
- if (!cType.isEmpty()) {
- m_clipType = (CLIPTYPE) cType.toInt();
- slotSetToolTip();
- }
-
- if (m_clipType == COLOR || m_clipType == IMAGE || m_clipType == SLIDESHOW || m_clipType == TEXT)
- element.setAttribute("duration", MAXCLIPDURATION);
- else if (element.attribute("duration").isEmpty() && !element.attribute("out").isEmpty()) {
- element.setAttribute("duration", element.attribute("out").toInt() - element.attribute("in").toInt());
- }
- }
-}