| 344 | unsigned int MyGraphicsVexItem::internalID = 0; |
| 345 | |
| 346 | MyGraphicsVexItem::MyGraphicsVexItem(QPointF _center, qreal _r, int nameID, QGraphicsItem *parent) : |
| 347 | QGraphicsEllipseItem(_center.x() - 0.5, _center.y() - 0.5, 1, 1, parent), |
| 348 | center(_center), |
| 349 | radius(_r){ |
| 350 | id = internalID++; |
| 351 | nameText = QString::asprintf("V%d", nameID); |
| 352 | nameTag = new QGraphicsSimpleTextItem; |
| 353 | nameTag->setPos(center + QPointF(radius, - radius - QFontMetrics(nameFont).height())); |
| 354 | nameTag->setFont(nameFont); |
| 355 | nameTag->setText(nameText); |
| 356 | nameTag->setZValue(this->zValue()); |
| 357 | this->setPen(Qt::NoPen); |
| 358 | this->setBrush(regBrush); |
| 359 | } |
| 360 | |
| 361 | void MyGraphicsVexItem::showAnimation(){ |
| 362 | //stopAnimation(); |