PDA

View Full Version : Add space after ScrollBar?



qtstarter121
31st July 2017, 18:02
I have a QScrollArea with a QGridLayout set via setLayout(). This scroll area is then added to a QMdiSubWindow.

I have an animation that hides this sub window on a QEvent::Leave, and the problem is that the vertical scroll bar of the QScrollArea is too close to the right edge of the QMdiSubWindow which I am filtering for leave events.

I need to add a sort of "buffer" region between my vertical scroll bar and the end of the sub window such that the hiding function is not as sensitive.

Not sure what the best way to do this is... any ideas?

What I tried was increasing the width of the sub window, also trying to set margins for the grid layout to add space to the right edge, adding a spacer item etc. but unfortunately none of this worked.

high_flyer
3rd August 2017, 16:04
I need to add a sort of "buffer" region between my vertical scroll bar and the end of the sub window such that the hiding function is not as sensitive.

Not sure I understand the problem...
For example, how is the behavior different if you leave to the left?
Then you don't have a scrollbar - and if in that case the behavior is satisfactory, I don't get the problem with the scroll area...

I must say that how your describe the problem and the proposed solution all sound very "hacky" to me.

Could you formulate what you need as a requirement?