derived classes for timeline objects

This commit is contained in:
itsmattkc
2019-08-04 05:37:30 +10:00
parent 2060490ac9
commit e5481b19f5
5 changed files with 48 additions and 5 deletions
@@ -23,8 +23,31 @@
#include <QPainter>
TimelineViewGhostItem::TimelineViewGhostItem(QGraphicsItem *parent) :
QGraphicsRectItem(parent)
TimelineViewRect(parent)
{
setBrush(Qt::NoBrush);
setPen(QPen(Qt::yellow, 2));
setPen(QPen(Qt::yellow, 2)); // FIXME: Make customizable via CSS
}
void TimelineViewGhostItem::SetIn(const rational &in)
{
in_ = in;
UpdateRect();
}
void TimelineViewGhostItem::SetOut(const rational &out)
{
out_ = out;
UpdateRect();
}
void TimelineViewGhostItem::UpdateRect()
{
rational length = out_ - in_;
setRect(0, 0, TimeToScreenCoord(length), 100);
setPos(TimeToScreenCoord(in_), 0);
}