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. How can I control the height of each widget in QToolBox

How can I control the height of each widget in QToolBox

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 470 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.
  • MihanM Offline
    MihanM Offline
    Mihan
    wrote on last edited by Mihan
    #1

    I want to control the QToolBox could be resized adaptively based on each widget I add into.
    e.g. the first item(widget) just has two buttons, so when the first tab is clicked, the first item should be showed in actual size( two buttons' size ) not the expanding size. On the other hand, when one item has so many buttons, it also should be showed in actual size( so many buttons' size ) not the expanding size with a scroll bar.
    So what should I do?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You would have to calculate its new size manually i think.
      Any layouts on the actual pages would not know that there can be several other page captions
      that should also count towards the total height.

      You could also make your own class that can do this.
      the toolbox is fairly small
      https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qtoolbox.h.html

      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