public:
BasicBlockWidget(const QString& name)
: x(-5), y(-20)
- , dx(250), dy(270)
+ , dx(270), dy(45)
, name(name) {
- _widget.addItem("THIS");
- _widget.addItem("IS");
- _widget.addItem("A");
- _widget.addItem("TEST");
- _widget.resize(dx-20, dy-20);
+ _widget.setMinimumWidth(_widget.sizeHintForColumn(0) + 10);
+ _widget.setMaximumHeight(20);
+ dx = _widget.sizeHintForColumn(0) + 20;
+ if (dx < 270) dx = 270;
}
+ void addItem(const QString& line) {
+ _widget.addItem(line);
+ _widget.updateGeometry();
+ _widget.setMinimumWidth(_widget.sizeHintForColumn(0) + 10);
+ _widget.setMinimumHeight(_widget.sizeHintForRow(0) * (1 + _widget.count()));
+ _widget.setMaximumHeight(_widget.sizeHintForRow(0) * (1 + _widget.count()));
+ dy = _widget.sizeHintForRow(0) * (1 + _widget.count()) + 25;
+ dx = _widget.sizeHintForColumn(0) + 20;
+ if (dx < 270) dx = 270;
+ }
+
QRectF boundingRect() const
{
qreal penWidth = 1;