The reason is simple and I can tell you just by looking at your code - you didn't use layouts and you didn't reimplement sizeHint(). At least one of the two has to be used for layouts to work. Otherwise QWidget::sizeHint() will be used and I'm sure it doesn't return a reasonable size for your widget.