This is a problem I've been struggling with for quite some time. It appears that some versions off Qt need the position of the widgets placed inside viewport margins to be offsetted when scrollbars are visible and some don't. The issue being that I have not yet managed to determine how each version (and platform?) behave so as to use some macro tricks to get rid of that annoyance.