Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Layout spacing not working on MacOS X + cannot get rid of frame around layout



  • Hi,
    I have an application that runs shows perfectly fine in Windows. However, when built on MacOS X, the layout is broken in Qt 5.9.2 and Qt 5.9.4.

    In one instance, a horizontal layout has a spacing of 6, but all the buttons not separated by spacers are pushed one against each other,:
    0_1517588659960_c40bd3e4-b00d-4dae-8fc0-cf7586a843b5-image.png

    The same layout in Windows shows the correct spacing:
    0_1517588681956_f55d601c-fe5a-4bf0-92c6-98ae0ff6138e-image.png

    Also, I have another layout which contains a QLabel and a custom widget, and I can't get rid of the frame around the layout.
    0_1517588851416_821052fd-5075-4d61-b8af-73d72dc274b6-image.png

    Again, in Windows, this does not happen:
    0_1517588941366_10b981fb-05dc-43b7-b655-b120d69625da-image.png

    The contour around the level meter + qlabel is clearly from the layout, but since a QVBoxLayout has no style, where does that frame come from???

    Again, so much for Qt being cross-platform... Even a simple GUI setup cannot be ported directly without problems it seems...



  • For some reason, if I increase the layout spacing by a factor 3, the layout matches that of Windows, so I am now doing:

    #ifdef Q_OS_MAC
       ui->mediaButtonsLayout->setSpacing(18);
    #endif
    

    0_1517590483298_5b9ff695-52df-46d7-8b0a-68bb21344eea-image.png

    But still don't have a clue where that frame around the audio level layout comes from.


  • Lifetime Qt Champion

    Hi
    That does indeed look odd.
    Are win/mac running same resolution ?



  • @mrjj said in Layout spacing not working on MacOS X + cannot get rid of frame around layout:

    Are win/mac running same resolution

    Yes, they're both set to Full HD.

    Edit: I am an idiot. I forgot + didn't see that the layout was inside a QFrame which was set to StyledPanel + Raised... In Windows it is not visible under my current theme...
    OK. That's one down. Now the strange layout spacing problem...


Log in to reply