代码拉取完成,页面将自动刷新
#include "timeline.h"
TimeLine::TimeLine(QWidget *parent) :
QWidget(parent)
{
}
QColor Track::selectedColor = QColor(200,30,180);
QColor Track::selectedColorOutline = Track::selectedColor.lighter(30);
int Track::penWidth = 2;
bool Track::hasShadow = false;
float Track::thresholdShadow=0.0f;
int Track::rounded = 10;
TimeLine::TimeLine(QGraphicsView *_view, QWidget *_parent)
{
if (_view) view = _view;
else view = new QGraphicsView(this);
scene = view->scene();
setMouseTracking(true);
int xOffset =100;
for(int i =0; i < 10; i++){
QGraphicsItem *item = scene->addText(QString::number(i));
item->setPos(i*xOffset,-40);
}
indicator = new Indicator(height());
scene->addItem(indicator);
indicator->setZValue(101);
Track *track = new Track(200,QColor(Qt::cyan),scene);
scene->addItem(track);
track->setPos(QPointF(300,0));
}
TimeLine::~TimeLine()
{
}
void TimeLine::AddItem(QPointF pos, QRect rect, QPen pen, QBrush brush)
{
QGraphicsItem *item = scene->addRect(rect,pen,brush);
item->setPos(pos);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。