PDA

View Full Version : Setting the clipped region on a child QWidget



entropie
25th February 2014, 04:44
Hi,

I have a qwidget window that contains a child qlabel. The qlabel sits in the same place such that when scrolling the parent widget, the qlabel at some point is no longer visible -- the qlabel is clipped to the parent's region as expected. Problem is, the parent has a 2px border on its very edge, and when I scroll to a place where the qlabel is partially off of the parent region, the qlabel overlaps the border.

So basically I think what I want to do is set the clip region to be 2px smaller on each side than the parent rect.

What is the best / simplest way to do this?

I appreciate any help, thanks :)