Important: Please read the Qt Code of Conduct -

Troubles with layoutSpacing in a very simple VBoxLayout

  • Just moving from Qt4 to Qt5 and trying a simple Qt Designer dialog, having trouble with layoutSpacing. See first image below - 3 buttons in a VBoxLayout pushed up by a Vertical Spacer with everything default, including layoutSpacing in the containing vbox set to -1. Top half of image 1 shows Designer view, bottom half shows the open dialog in a minimal app. Close, but the inherited spacing is not right in the app.

    The second image has layoutSpacing changed to 3. Again, it's right in the Designer view but wildly wrong in the app.

    I've tried all kinds of things, setting fixed sizes, sizeHints, different constraint policies, always get this odd squashing.

    Any suggestions? Thanks - John.

    Image 1:
    alt text

    Image 2:
    alt text

Log in to reply