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. Align elements in QHBoxLayout
Qt 6.11 is out! See what's new in the release blog

Align elements in QHBoxLayout

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 11.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

    http://ompldr.org/vOTNycQ/tabbar.png
    On the picture — QToolBar with QAction, QTabBar and QToolBar with QToolBar and QAction. All of them are placed inside QHBoxLayout. One can see on the picture that QAction and QToolBar are located a little bit lower than QTabBar. Is it possible to align them? I mean raise slightly QToolBar's or raise QAction in order to make them more tidy.

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

      Each layout has many margins available. You could use multiple QHBoxLayout's for QTabBar and QToolBar.. and try and align them by adjusting the margins..

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

        Don't work.

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

          Try to Align QToolBar vertically:
          @QHBoxLayout::addWidget(widget, int stretch, Qt::AlignVCenter)@

          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