PDA

View Full Version : Match Height between 2 Adjoining QTableViews



ChrisW67
14th April 2009, 04:52
G'day All,

I am using two QTableViews side-by-side, based off the same model, to simulate the equivalent of Excel's Freeze Panes. The left view shows the first three columns of the model without a horizontal scroller. The right view shows the remaining columns with a horizontal scroller, allowing the user to pan across the columns. Vertical scrolling is linked between the views.

The two views are currently in a horizontal layout, which keeps them the same height. Unfortunately, this makes the content area of the left view taller than the content area of the right view by the height of the horizontal scroller. When scrolled to the bottom of the table the rows in the two table views get out of visual alignment. I'd like the left view's content area to stay the same height the right view's content area but haven't found the right piece of Qt signal-slot plumbing to achieve this.

Could some kind soul please nudge me in the right direction?

Regards,
Chris W