Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Height of QWidget containing two QLabels
Qt 6.12 LTS is out! See what's new in the release blog

Height of QWidget containing two QLabels

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 451 Views 2 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.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by
    #1

    I've got a widget using a vertical layout that contains two labels.

    The height for each label is 16 according to designer but the widget ends up 52 high.

    Where did the remaining 20 pixels go?

    How to adjust things so the widget only takes (say) 6 pixels more that the sum of the heights of its contents?

    Thanks
    David

    M 1 Reply Last reply
    0
    • PerdrixP Perdrix

      I've got a widget using a vertical layout that contains two labels.

      The height for each label is 16 according to designer but the widget ends up 52 high.

      Where did the remaining 20 pixels go?

      How to adjust things so the widget only takes (say) 6 pixels more that the sum of the heights of its contents?

      Thanks
      David

      M Offline
      M Offline
      mpergand
      wrote on last edited by mpergand
      #2

      @Perdrix
      Look at the contents margins and spacing default values for layout in the designer.

      PerdrixP 1 Reply Last reply
      2
      • M mpergand

        @Perdrix
        Look at the contents margins and spacing default values for layout in the designer.

        PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by
        #3

        @mpergand Thank you - that's what I needed!!!

        I adjusted the layout top and bottom margins to 2 and also the spacing to 2.

        That worked a treat!
        Thanks again, David

        1 Reply Last reply
        0
        • PerdrixP Perdrix has marked this topic as solved on

        • Login

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