Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-79551

QBoxLayout embedded in QGridLayout spacing bug

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Component/s: Widgets: Layout
    • Labels:
      None

      Description

      In this example I have a QBoxLayout embedded in a QGridLayout. The QGridLayout has the verticalSpacing set, but not the horizontalSpacing. I would expect the QBoxLayout spacing to fall back to QStyle::PM_LayoutHorizontalSpacing. It does not, instead a spacing of 0 is used.

       

      By stepping through this I found I could fix it by overriding QStyle::layoutSpacing, but that directly contradicts that documentation for layoutSpacing, which claims it is ignored unless PM_LayoutHorizontalSpacing is negative.

       

      It can also, obviously, be worked around by manually setting the spacing for the QBoxLayout.

        Attachments

        1. 79551.png
          79551.png
          195 kB
        2. spacingbug.ui
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            noah Noah Hamerslough
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes