, name(name), block(block)
, _proxy(this) {
next[0] = NULL; next[1] = NULL;
+ _widget.setStyleSheet("QTableWidget { background-color : #ddddff; }");
+ _widget.setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
+ _widget.verticalHeader()->setDefaultSectionSize(18);
+ _widget.setColumnCount(3);
+ _widget.verticalHeader()->hide();
+ _widget.horizontalHeader()->hide();
+ _widget.setShowGrid(false);
+ _widget.setWordWrap(false);
+ _widget.setMinimumSize(210, 40);
+
_proxy.setWidget(&_widget);
- _widget.setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::LinksAccessibleByMouse);
- _widget.setStyleSheet("QLabel { background-color : #ddddff; }");
_proxy.setPos(5, 20);
- if (width < 270) width = 270;
+ if (width < 250) width = 250;
}
void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes,
bytestring += ' ';
}
- QString old_text = _widget.text();
- if (old_text == "") {
- old_text = "<table>";
- }
-
- line = line.toHtmlEscaped();
- if (href != "") {
- line = "<a href=\"" + href + "\">" + line + "</a>";
- }
+ int current_row = _widget.rowCount();
+ _widget.setRowCount(1 + current_row);
+ _widget.setItem(current_row, 0, new QTableWidgetItem(bytestring));
+ _widget.setItem(current_row, 1, new QTableWidgetItem(line.replace('\t', ' ')));
+// _widget.setItem(current_row, 2, new QTableWidgetItem(href));
- QString new_text =
- old_text.remove("</table>") +
- "<tr><td>" + bytestring +
- "</td><td>" + line +
- "</td><td>" + "" +
- "</td></tr></table>";
+ _widget.resizeColumnToContents(0);
+ _widget.resizeColumnToContents(1);
+ _widget.resizeColumnToContents(2);
- _widget.setText(new_text);
width = 12 + _widget.sizeHint().width();
height = 25 + _widget.sizeHint().height();