]>
git.siccegge.de Git - frida/frida.git/blob - src/gui/widgets/BasicBlockWidget.cxx
1 #include "BasicBlockWidget.hxx"
3 BasicBlockWidget::BasicBlockWidget(const QString
& name
)
7 _widget
.setGridStyle(Qt::NoPen
);
8 _widget
.setMinimumHeight(_widget
.rowHeight(0) + 10);
9 _widget
.setMaximumHeight(20);
10 _widget
.resizeColumnToContents(0);
11 _widget
.resizeColumnToContents(1);
12 _widget
.resizeColumnToContents(2);
13 _widget
.updateGeometry();
14 _widget
.setMaximumWidth(260);
15 _widget
.setColumnCount(3);
16 _widget
.verticalHeader()->hide();
17 _widget
.horizontalHeader()->hide();
18 dx
= _widget
.rowHeight(0) + 20;
19 if (dx
< 270) dx
= 270;
22 void BasicBlockWidget::addItem(uint8_t* bytes
, size_t num_bytes
,
23 const QString
& line
) {
24 size_t current_row
= _widget
.rowCount();
29 for (size_t i(0); i
< num_bytes
; ++i
) {
30 const char * hexdigits
= "0123456789ABCDEF";
31 bytestring
+= hexdigits
[(bytes
[i
] >> 4) & 0xF];
32 bytestring
+= hexdigits
[bytes
[i
] & 0xF];
36 _widget
.setRowCount(current_row
+ 1);
38 _widget
.setItem(current_row
, 0, new QTableWidgetItem(bytestring
));
39 _widget
.setItem(current_row
, 1, new QTableWidgetItem(line
));
40 _widget
.setItem(current_row
, 2, new QTableWidgetItem(""));
41 _widget
.updateGeometry();
43 _widget
.resizeColumnToContents(0);
44 _widget
.resizeColumnToContents(1);
45 _widget
.resizeColumnToContents(2);
47 _widget
.resizeRowToContents(current_row
);
50 _widget
.columnWidth(0) +
51 _widget
.columnWidth(1) +
52 _widget
.columnWidth(2) +
55 _widget
.setMinimumWidth(column_width
);
56 _widget
.setMinimumHeight(_widget
.rowHeight(0) * (_widget
.rowCount()) + 2);
57 _widget
.setMaximumHeight(_widget
.rowHeight(0) * (_widget
.rowCount()) + 2);
60 dy
= _widget
.rowHeight(0) * (_widget
.rowCount()) + 25;
61 dx
= column_width
+ 10;
62 if (dx
< 270) dx
= 270;