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
Forum Updated to NodeBB v4.3 + New Features

QTabWidget size, header height

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 315 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 28 Apr 2021, 02:23 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
    • N Offline
      N Offline
      nagesh
      wrote on 28 Apr 2021, 10:16 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 28 Apr 2021, 12:37 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.

        J 1 Reply Last reply 28 Apr 2021, 19:17
        0
        • S stretchthebits
          28 Apr 2021, 12:37

          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.

          J Offline
          J Offline
          JoeCFD
          wrote on 28 Apr 2021, 19:17 last edited by
          #4

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

          1 Reply Last reply
          0

          1/4

          28 Apr 2021, 02:23

          • Login

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