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. QTabWidget size, header height
Qt 6.11 is out! See what's new in the release blog

QTabWidget size, header height

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 614 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.
  • S Offline
    S Offline
    stretchthebits
    wrote on last edited by
    #1

    Allo all,
    There is the member function setGeometry that can be used to set the position and size of a QTabWidget.
    setGeometry(posX, posY, TheWidth, TheHeight)

    But how can I find out the size of the header?
    You know, the upper part where the text shows up?
    Because, perhaps on one OS, if I give it TheHeight, the header size would be 30 pixels and on other OS, it might be 60 pixels.
    This doesn’t leave much room for the stuff I will show on the client area of the QTabWidget.

    I need a
    someMore = GetTabHeaderHeight();

    and then, I will call
    setGeometry(posX, posY, TheWidth, someMore + TheHeight);

    1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on last edited by
      #2

      @stretchthebits why do you want to handle the size of client area manually. Use layout to manage the size.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stretchthebits
        wrote on last edited by
        #3

        Nagesh, because I'm not sure how to use layout and in the example that I saw, it looks like it has a mind of its own. I prefer having full control.

        JoeCFDJ 1 Reply Last reply
        0
        • S stretchthebits

          Nagesh, because I'm not sure how to use layout and in the example that I saw, it looks like it has a mind of its own. I prefer having full control.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @stretchthebits https://gist.github.com/espdev/4f1565b18497a42d317cdf2531b7ef05
          you can use stylesheet to change it.

          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