I need a QScrollArea that only scrolls vetically. Horizontally, it should behave like a normal widget.

I've seen this thread here: http://qt-project.org/forums/viewthread/13728

However, the solution proposed there subclasses QScrollArea and manages the widget internally (it calls setWidget() in its constructor). I need something where the setWidget() can be called at a later time. The problem with this approach is that it sets an event filter on the widget, but if that can't be done in the constructor, I don't see where else a subclass can get access to the widget to install the filter.

Additionally, the size of the widget may change dynamically.

Any ideas?