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

QBoxLayout embedded in QGridLayout spacing bug

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.3
    • Widgets: Layout
    • 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. spacingbug.ui
          3 kB
        2. 79551.png
          79551.png
          195 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            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