[Interest] How to obtain padding and border styling for QFrame derived control

Tony Rietwyk tony at rightsoft.com.au
Sun Oct 6 06:16:40 CEST 2019


Hi Everybody,

I have a QFrame derived widget that is styled using an application style 
sheet with optional padding and borders.  In the minimumSizeHint, I need 
to get the currently active values from the style sheet.  I would like 
to use sizeFromContents, but there is no ContentsType CT_Frame to adjust 
my contents rect.

In the paint event, I call QFrame::paintEvent to do the background and 
borders, then I paint my contents.  I expect contentsRect to be smaller 
due to the border and padding, but it isn't.  How can I get (or allow 
for) the style sheet values?

Regards, Tony



More information about the Interest mailing list