This question is regarding QT4.

I am using QWorkspace to implement an MDI application. The app is a database design tool, and I am using the windows in the QWorkspace to represent DB tables. I am painting on the background to represent relations between the tables. Everything works fine except when the workspace is scrolled. First of all, I draw my relations based on "pristine" coordinates, so the relations do not scroll with the tables. Second, when I want to save out the positions of everything, I want to save out their unscrolled positions.

The bottom line is that I need to retrieve the current scroll state of the QWorkspace, but I cannot seem to find any way to do it. There doesn't seem to be any "scroll" signal emitted, nor anything I can trap in an eventfilter. The actual scrollbars themselves are private and inaccesible to my class which inherits from QWorkspace. I know there are nasty workarounds, but I could solve this problem very cleanly if I could simply figure out the current scroll state.

Is there any way to retrieve the current scroll offsets in a QWorkspace?