int AbstractGroupItem::type() const
{
- return GROUPWIDGET;
+ return GroupWidget;
}
int AbstractGroupItem::track() const
int topTrack = -1;
QList<QGraphicsItem *> children = childItems();
for (int i = 0; i < children.count(); ++i) {
- if (children.at(i)->type() == GROUPWIDGET) {
+ if (children.at(i)->type() == GroupWidget) {
children.append(children.at(i)->childItems());
continue;
}
QPainterPath AbstractGroupItem::clipGroupSpacerShape(const QPointF &offset) const
{
- return spacerGroupShape(AVWIDGET, offset);
+ return spacerGroupShape(AVWidget, offset);
}
QPainterPath AbstractGroupItem::clipGroupShape(const QPointF &offset) const
{
- return groupShape(AVWIDGET, offset);
+ return groupShape(AVWidget, offset);
}
QPainterPath AbstractGroupItem::transitionGroupShape(const QPointF &offset) const
{
- return groupShape(TRANSITIONWIDGET, offset);
+ return groupShape(TransitionWidget, offset);
}
-QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, const QPointF &offset) const
+QPainterPath AbstractGroupItem::groupShape(GraphicsRectItem type, const QPointF &offset) const
{
QPainterPath path;
QList<QGraphicsItem *> children = childItems();
QRectF r(children.at(i)->sceneBoundingRect());
r.translate(offset);
path.addRect(r);
- } else if (children.at(i)->type() == GROUPWIDGET) {
+ } else if (children.at(i)->type() == GroupWidget) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
if (subchildren.at(j)->type() == (int)type) {
return path;
}
-QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, const QPointF &offset) const
+QPainterPath AbstractGroupItem::spacerGroupShape(GraphicsRectItem type, const QPointF &offset) const
{
QPainterPath path;
QList<QGraphicsItem *> children = childItems();
r.translate(offset);
r.setRight(scene()->width());
path.addRect(r);
- } else if (children.at(i)->type() == GROUPWIDGET) {
+ } else if (children.at(i)->type() == GroupWidget) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
if (subchildren.at(j)->type() == (int)type) {
QList<QGraphicsItem *> children = childItems();
for (int i = 0; i < children.count(); ++i) {
int currentTrack = 0;
- if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET) {
+ if (children.at(i)->type() == AVWidget || children.at(i)->type() == TransitionWidget) {
currentTrack = static_cast <AbstractClipItem*> (children.at(i))->track();
if (!groupTracks.contains(currentTrack)) groupTracks.append(currentTrack);
}
- else if (children.at(i)->type() == GROUPWIDGET) {
+ else if (children.at(i)->type() == GroupWidget) {
currentTrack = static_cast <AbstractGroupItem*> (children.at(i))->track();
}
else continue;
- if (children.at(i)->type() == AVWIDGET) {
+ if (children.at(i)->type() == AVWidget) {
if (topTrack == -1 || currentTrack <= topTrack) {
offset = 0;
topTrack = currentTrack;
}
- } else if (children.at(i)->type() == TRANSITIONWIDGET) {
+ } else if (children.at(i)->type() == TransitionWidget) {
if (topTrack == -1 || currentTrack < topTrack) {
offset = (int)(trackHeight / 3 * 2 - 1);
topTrack = currentTrack;
}
- } else if (children.at(i)->type() == GROUPWIDGET) {
+ } else if (children.at(i)->type() == GroupWidget) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
bool clipGroup = false;
for (int j = 0; j < subchildren.count(); j++) {
- if (subchildren.at(j)->type() == AVWIDGET || subchildren.at(j)->type() == TRANSITIONWIDGET) {
+ if (subchildren.at(j)->type() == AVWidget || subchildren.at(j)->type() == TransitionWidget) {
int subTrack = static_cast <AbstractClipItem*> (subchildren.at(j))->track();
if (!groupTracks.contains(subTrack)) groupTracks.append(subTrack);
clipGroup = true;
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); ++i) {
- if (children.at(i)->type() == GROUPWIDGET) {
+ if (children.at(i)->type() == GroupWidget) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
collidingItems.removeAll(subchildren.at(j));
int offset = 0;
for (int i = 0; i < collidingItems.count(); ++i) {
QGraphicsItem *collision = collidingItems.at(i);
- if (collision->type() == AVWIDGET) {
+ if (collision->type() == AVWidget) {
// Collision
if (newPos.y() != pos().y()) {
// Track change results in collision, restore original position
collidingItems = scene()->items(clipGroupShape(newPos - pos()), Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); ++i) {
- if (children.at(i)->type() == GROUPWIDGET) {
+ if (children.at(i)->type() == GroupWidget) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
collidingItems.removeAll(subchildren.at(j));
collidingItems.removeAll(children.at(i));
}
for (int i = 0; i < collidingItems.count(); ++i)
- if (collidingItems.at(i)->type() == AVWIDGET) return pos();
+ if (collidingItems.at(i)->type() == AVWidget) return pos();
}
}
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); ++i) {
- if (children.at(i)->type() == GROUPWIDGET) {
+ if (children.at(i)->type() == GroupWidget) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
collidingItems.removeAll(subchildren.at(j));
int offset = 0;
for (int i = 0; i < collidingItems.count(); ++i) {
QGraphicsItem *collision = collidingItems.at(i);
- if (collision->type() == TRANSITIONWIDGET) {
+ if (collision->type() == TransitionWidget) {
// Collision
if (newPos.y() != pos().y()) {
// Track change results in collision, restore original position
collidingItems.removeAll(children.at(i));
}
for (int i = 0; i < collidingItems.count(); ++i)
- if (collidingItems.at(i)->type() == TRANSITIONWIDGET) return pos();
+ if (collidingItems.at(i)->type() == TransitionWidget) return pos();
}
}
return newPos;
QList<QGraphicsItem *> selection = scene()->items(dropPos);
AbstractClipItem *dropChild = NULL;
for (int i = 0; i < selection.count(); ++i) {
- if (selection.at(i)->type() == AVWIDGET) {
+ if (selection.at(i)->type() == AVWidget) {
dropChild = (AbstractClipItem *) selection.at(i);
break;
}
QList <QGraphicsItem *>list = scene()->items(event->scenePos());
// only allow group move if we click over an item in the group
foreach(const QGraphicsItem *item, list) {
- if (item->type() == TRANSITIONWIDGET || item->type() == AVWIDGET) {
+ if (item->type() == TransitionWidget || item->type() == AVWidget) {
QGraphicsItem::mousePressEvent(event);
return;
}
int itemcount = 0;
for (int i = 0; i < children.count(); ++i) {
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
- if (item && item->type() == AVWIDGET) {
+ if (item && item->type() == AVWidget) {
items << item;
if (info)
m_resizeInfos << item->info();
int itemcount = 0;
for (int i = 0; i < children.count(); ++i) {
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
- if (item && item->type() == AVWIDGET) {
+ if (item && item->type() == AVWidget) {
items << item;
if (info)
m_resizeInfos << item->info();
GenTime start = GenTime(-1.0);
GenTime end = GenTime();
for (int i = 0; i < children.count(); ++i) {
- if (children.at(i)->type() != GROUPWIDGET) {
+ if (children.at(i)->type() != GroupWidget) {
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
if (item) {
if (start < GenTime() || item->startPos() < start)