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. Can't get QPushButton to center vertically in a QGridLayout cell
Forum Updated to NodeBB v4.3 + New Features

Can't get QPushButton to center vertically in a QGridLayout cell

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

    I have a QPushButton I am trying to get to center vertically next to a text field and for the life of me, I can't figure out how to do it!

    Here's a image showing the problem:
    !http://i.imgur.com/ltkwqUm.png()!

    I don't understand how other items "get it" like labels and textfields and spinner fields. But then comes along a QPushButton and it has to be different!

    I have tried this with the buttons style sheet, with no success obviously:

    @QPushButton {border-width: 0px; padding: 0px}@

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      How have you tried to do it?

      If you used Designer then right-click on each push button and select "Center Vertically" from the Layout Alignment menu. If you used code then you do the equivalent with QLayout::setAlignment().

      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