@mrjj I actually want to print to an actual printer. So, using a PDF in between is not an option.
Just as I said: the margins of the QPrinter::pageLayout() do not work as one would expect. In order to be able to print close to the border, you have to turn on full page mode and set the margins of the QPrinter directly. I am not entirely sure (as I have a huge code base involved converting wxWidgets to Qt), but it looks like setting the margins of QPrinter actually prints with that margin (in contrast to what the documentation suggests). For me the problems are now solved.
To clarify what @J-Hilk is saying (which I believe to be correct): a QLayout is not a QWidget and so cannot have its attributes affected via a stylesheet rule (sadly). That has to be done via explicit, back-end code.
Here we go! That was the problem! Layout cannot be affected by a stylesheet file! Now I know how styling layout works! Thank!
As the solution suggested by @hskoglund is Windows-specific, I decided to first investigate a bit deeper the other options presented by @J-Hilk
It turned out that the Qt::WindowStaysOnTopHint flag was not set for our main window. I am now setting that flag in our main windows's constructor, and afterwards show it full screen. This seems to work.