Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Size Policy of Push Buttons, inside a Layout
Qt 6.11 is out! See what's new in the release blog

Size Policy of Push Buttons, inside a Layout

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.2k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I started to explore QT Creator 4 days ago, and I absolutely love it.
    However I have an Issue with the Size policy of Push buttons.
    To get familiar with QT I wanted to start with something simple, and decided to
    Create a simple calculator, nothing fancy. The Pushbuttons should be square no matter what size the window is. Everything works fine but the Pushbuttons always stretch themselves horizontally at runtime if they are inside a layout, no matter what I use for Size Policy. Even if I use Fixed, or Ignore. It doesn't seam to matter what size policy I choose for the Buttons or
    The layout.
    Any idears what i might doing wrong?
    Thank you.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Try to put a horizontal spacer on the right side of your row of push buttons. A spacer will push the buttons to keep them at bay.

      (Z(:^

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        After reading thru some documented Examples I found out what is going on. In the FormEditor the Main Layout is not visible, thus you have to select it in the Hierarchy view. So every setting I changed in the Gridlayout and its children was overwritten by the centralWidget Layout. Now it works fine.

        Horizontal spacers work to, but if you rescale the Window the buttons are still pressed against the side.

        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