Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mainwindow content gets vignetted at border
Qt 6.11 is out! See what's new in the release blog

Mainwindow content gets vignetted at border

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 851 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • gde23G Offline
    gde23G Offline
    gde23
    wrote on last edited by
    #1

    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?

    jsulmJ 1 Reply Last reply
    0
    • gde23G gde23

      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?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • gde23G Offline
        gde23G Offline
        gde23
        wrote on last edited by
        #3

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

        jsulmJ 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • gde23G gde23

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

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • gde23G Offline
              gde23G Offline
              gde23
              wrote on last edited by
              #6

              @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.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved