0
votes

I have a QStackedWidget that I add multiple QWidget() objects to. Each QWidget has its own layout. For some reason when it adds the QWidget to the QStacked widget, it doesn't add it to say location "0,0"... it seems to always inlay it by 3 or 4 pixels from each edge of the QStackedWidget. See picture for an example...I made the QStackedWidget background black so it is easy to see the gap.

The question is, how can I eliminate this gap and get the QWidget to align perfectly with the QStackedWidget?

enter image description here

1
have you tried yourStackedWidget->setContentsMargins(0,0,0,0)?Miki
Yes I have....does nothing.user2494298

1 Answers

1
votes

If I use the "setContentsMargins(0,0,0,0) on the layout I use for the QWidget the gap goes away.

That is the solution.