Important: Please read the Qt Code of Conduct -

Mainwindow content gets vignetted at border

  • Hello,

    I have a problem with a project when running it on a Windows 10 machine (Dell-Laptop).
    The problem is, that the outer border of the QMainWindow gets vignetted. Like if the content of the QMainWindow is scaled by some % so it does not fit inside the window any more. The vignetting is maybe 10-20 pixels on all sides of the window. Any widget that is there just gets cut off.

    I am not sure, but maybe it has something to do with the High-DPI settings? I using following settings for High-DPI support (the device with the problem does not have a High-DPI display)

    in main()

    QSurfaceFormat fmt;

    and in Qt.conf

    WindowsArguments = dpiawareness=0

    Any ideas what could be the reason?

  • Lifetime Qt Champion

    @gde23 Do you use layouts to position and size the widgets?

  • The main window is set up in Qt Designer (which will automatically generate the layouts) and some additional layouts are added in code.

  • Lifetime Qt Champion


    Can you show a screenshot of what you are getting ?
    Can you provide a minimal compilable example that shows that behaviour ?
    What version of Qt are you using ?

    Are you sure all your designer widgets are indeed in a layout ? AFAIR, Designer does not generate layouts automatically you have to tell it that you want one when putting things together.

  • Lifetime Qt Champion

    @gde23 said in Mainwindow content gets vignetted at border:

    which will automatically generate the layouts

    It does not, you have to layout your widgets the way you want them to be layd out.

  • @SGaist: here is a screenshot of the GUI.
    On the top there is a QTabWidget where the QTabBar is normally visible, however here it is vignetted. The vignetting can also be seen on the bottom, where the StatusBar is cut off half.

    The GUI is using a stylesheet, that is why the QDockWidgets look a bit different than usual.
    In the designer of course I have set a layout and added all the widgets to the layout.
    The Qt Version is 5.13.0 and I have been tried it on several machnies Linux and Windows (also with High-DPI Screen scaling turned on in Windows) which works fine on any machine I've tested it, except on that one Dell-Notebook with Windows 10.

Log in to reply