From 2227e316e52bbca8bec594d0bb487f6c0c2ba08f Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Thu, 12 Mar 2015 16:46:00 +0100 Subject: [PATCH] [BasicBlockWidget] Adjust inner widget size before drawing Adjust size of the innner QGraphicsTextItem before getting it's size for drawing the outer parts. That way the BasicBlockWidget always has the correct size matching it's content Closes: T20 --- src/gui/widgets/BasicBlockWidget.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/BasicBlockWidget.cxx b/src/gui/widgets/BasicBlockWidget.cxx index a2312c2..4889cb4 100644 --- a/src/gui/widgets/BasicBlockWidget.cxx +++ b/src/gui/widgets/BasicBlockWidget.cxx @@ -156,6 +156,7 @@ void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) { + _widget->adjustSize(); width = 10 + _widget->boundingRect().width(); height = 25 + _widget->boundingRect().height(); if (width < 250) width = 250; -- 2.39.2