Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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()

    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QSurfaceFormat fmt;
    fmt.setSamples(10);
    QSurfaceFormat::setDefaultFormat(fmt);
    

    and in Qt.conf

    [Platforms]
    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

    Hi,

    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.
    vignetted.jpg

    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