QAction* act = menu.addAction(c.selectedText() + " is a Function");
QObject::connect(act, &QAction::triggered,
[=]() {
- parent->mainwindow->requestNewFunctionByAddress(address);
+ emit parent->mainwindow->requestNewFunctionByAddress(address);
if (NULL == table) return;
int row = table->cellAt(c).row();
uint64_t insAddress = parent->instructions[row].getAddress();
QGraphicsTextItem* item = _widget.get();
item->setDocument(document);
item->adjustSize();
+ updateSize();
}
QString BasicBlockWidget::formatComments(Instruction* inst) {
return (comments.empty() ? "" : ";; ") + comments.join("<br />").trimmed();
}
-void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,
- QWidget*) {
+void BasicBlockWidget::updateSize() {
+ prepareGeometryChange();
width = 10 + _widget->boundingRect().width();
height = 25 + _widget->boundingRect().height();
if (width < 250) width = 250;
+}
+
+void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,
+ QWidget*) {
+ updateSize();
painter->fillRect(0, 0, width, height, currentColor);
painter->setPen(QColor(0x00, 0x00, 0xff, 0xff));