From: Christoph Egger Date: Tue, 27 May 2014 15:24:27 +0000 (+0200) Subject: resize widgets to fit content X-Git-Tag: v0.1~187 X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=commitdiff_plain;h=b5f582057f66328e643cdff8181308fba7641185;hp=4aac2a789fa54a5d6d9bc2c52b663044fab3cb40 resize widgets to fit content --- diff --git a/src/gui/widgets/BasicBlockWidget.hxx b/src/gui/widgets/BasicBlockWidget.hxx index ec443f3..803331c 100644 --- a/src/gui/widgets/BasicBlockWidget.hxx +++ b/src/gui/widgets/BasicBlockWidget.hxx @@ -7,11 +7,18 @@ public: : x(-5), y(-20) , dx(250), dy(270) , name(name) { - _widget.resize(dx-20, dy-20); + _widget.setMinimumWidth(_widget.sizeHintForColumn(0) + 10); + dy = _widget.sizeHint().height() + 20; + dx = _widget.sizeHintForColumn(0) + 10; + if (dx < 270) dx = 270; } void addItem(const QString& line) { _widget.addItem(line); + _widget.setMinimumWidth(_widget.sizeHintForColumn(0)); + dy = _widget.sizeHint().height() + 20; + dx = _widget.sizeHintForColumn(0) + 10; + if (dx < 270) dx = 270; } QRectF boundingRect() const