try using setMinimumSize() and setMaximumSize() on progressbar.

resize may not help as quoted in resize documentation -
The size is adjusted if it lies outside the range defined by minimumSize() and maximumSize(). For windows, the minimum size is always at least QSize(1, 1), and it might be larger, depending on the window manager.
hope this helps