user2494298
user2494298

Reputation: 299

Adding QWidget without layout to QStackedWidget inlay gap

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

Upvotes: 0

Views: 256

Answers (1)

user2494298
user2494298

Reputation: 299

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.

Upvotes: 1

Related Questions