Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to completely remove the margin of a QHBoxLayout in Mac?
Forum Update on Monday, May 27th 2025

How to completely remove the margin of a QHBoxLayout in Mac?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.9k Views
  • 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.
  • F Offline
    F Offline
    frinker
    wrote on last edited by
    #1

    Hi,

    Recently I found the Qt widgets have 2 pixels extra margin when it's in a QHBoxLayout. This happens on Mac, but not Windows. This troubles me a lot because I want the widgets aligned.

    You can see the "example screen shot":http://www.imagehousing.com/image/819920. I add 4 QCheckBoxes in the group, and the second QCheckBox is surrounded by a QHBoxLayout, whose margin and spacing is set to 0, and then the 4 QCheckBoxes are not aligned.

    So what else can I do?

    Thanks,
    DJ

    BTW, how can I upload images in this forum?

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      A simple solution for your problem is to use the same layouts for widgets like that or use a QGridlayout for all your widgets.

      bq. BTW, how can I upload images in this forum?

      Yes you can. see the "forum help page":http://developer.qt.nokia.com/wiki/ForumHelp#9bd9c32b79efb1b2d5b039e4d48300a9.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0

      • Login

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