标签:int 直线 div 次数 out time etl 一条直线 tran
QGraphicsLineItem *line;
scene->addItem(line = new QGraphicsLineItem(QLineF(QPointF(0, 0), QPointF(300, 300)))); //在创景窗口中画一条直线
line->setPen(QPen(Qt::DashDotDotLine));
QGraphicsItemAnimation *animation = new QGraphicsItemAnimation;
animation->setItem(line);
//scene->addItem(animation);
//怎样动需要QTimeLiness函数
QTimeLine *timeline = new QTimeLine(); //持续三秒钟
timeline->setLoopCount(NULL); //设置循环次数
animation->setTimeLine(timeline);
//animation->rotationAt(45); //以怎样的角度进行旋转
animation->setTranslationAt(1, 200, 200);
timeline->start();
_timer = new QTimer();
_timer->setInterval(1000); //设置间隔时间
connect(_timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
_timer->start();
标签:int 直线 div 次数 out time etl 一条直线 tran
原文地址:https://www.cnblogs.com/Werial/p/12552951.html