[Interest] Matching borders between QFrame and QGraphicsView

Matthew Woehlke mwoehlke.floss at gmail.com
Tue Nov 3 18:45:57 CET 2020

I'm doing some heavily tweaked rendering, and having trouble getting 
frames to render correctly. In particular, I have (subclasses of) QFrame 
and QGraphicsView.

The QGraphicsView seems "mostly" sane except that I can't get it to use 
all the way to the widget's outer edge... but that's not necessarily the 
end of the world.

The problem I'm having is that QFrame has the same issue, but here, I 
*do* need it to use all the way to the edges of the widget. I can make 
that happen by fiddling with the contents margins... but then I run into 

If I adjust the contents margins, I can get the frame to use its entire 
size, *BUT* this also pushes the frame border outside the widget. I can 
compensate by tweaking the render code... but then the QGraphicsView is 
wrong, because changing the contents margins on that has no effect on 
the frame.

Why does the behavior differ, and how can I fix it? (I'd rather not have 
to tweak the style rendering to have to be sensitive to what QFrame 
subclass it is drawing...)


More information about the Interest mailing list