]> git.siccegge.de Git - frida/frida.git/blob - src/gui/widgets/BasicBlockWidget.hxx
Properly create and export BasicBlock linking
[frida/frida.git] / src / gui / widgets / BasicBlockWidget.hxx
1 #include "gui/qt.hxx"
2
3 class BasicBlockWidget : public QGraphicsItem
4 {
5 public:
6 BasicBlockWidget() {
7 x = -5;
8 y = -20;
9 dx = 250;
10 dy = 270;
11 _widget.addItem("THIS");
12 _widget.addItem("IS");
13 _widget.addItem("A");
14 _widget.addItem("TEST");
15 _widget.resize(dx-20, dy-20);
16 }
17
18 QRectF boundingRect() const
19 {
20 qreal penWidth = 1;
21 return QRectF(x - penWidth / 2, y - penWidth / 2,
22 dx + penWidth, dy + penWidth);
23 }
24
25 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
26 QWidget *widget)
27 {
28 painter->fillRect(x, y, dx, dy, QColor(0xcc, 0xcc, 0xff, 0xff));
29 painter->setPen(QColor(0x00, 0x00, 0xff, 0xff));
30 painter->drawRect(x, y, dx, dy);
31 painter->drawText(0, -5, "BLOCK");
32 _widget.render(painter);
33 }
34 private:
35 int x, y, dx, dy;
36 QListWidget _widget;
37 };