3 class BasicBlockWidget : public QGraphicsItem
6 BasicBlockWidget(const QString& name)
10 _widget.resize(dx-20, dy-20);
13 void addItem(const QString& line) {
14 _widget.addItem(line);
17 QRectF boundingRect() const
20 return QRectF(x - penWidth / 2, y - penWidth / 2,
21 dx + penWidth, dy + penWidth);
24 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
27 painter->fillRect(x, y, dx, dy, QColor(0xcc, 0xcc, 0xff, 0xff));
28 painter->setPen(QColor(0x00, 0x00, 0xff, 0xff));
29 painter->drawRect(x, y, dx, dy);
30 painter->drawText(0, -5, name);
31 _widget.render(painter);