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. QToolBox Resizing issues
Qt 6.11 is out! See what's new in the release blog

QToolBox Resizing issues

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 9.0k 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.
  • W Offline
    W Offline
    webmaster.skelton
    wrote on last edited by
    #1

    I have a toolbox with multiple tabs. Within each region there are editable fields. After so many tabs are added that area turns into a scrollable area instead of simply resizing itself. So my question is, is there a way to set the size of the contained frame so that no matter how much i add the ToolBox widget items never get smaller. that way when i expand and area everything contained within that area is visible? I am starting to think this is a limitation with QToolBox.

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      if I got you right, you want the frame that contains the toolbox to expand as you keep adding more toolbox widget items.

      does the frame have the right size policy? does the container of the frame and its layout allow it to resize? at some point you will hit the application's mainwindow size limit, how do you propose to handle it then?

      1 Reply Last reply
      0
      • W Offline
        W Offline
        webmaster.skelton
        wrote on last edited by
        #3

        No I use a scroll area for that, i need to be able to have a set size within the toolbox viewing area as i add new tabs to it. The more tabs you add the more in compresses the viewing area of the active tab. I need that viewing area to stay a fixed size. I have not been able to find anything in the documentation that suggests this is possible which is why I am asking.

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          You can have a custom page (with a fixed custom size) and a fixed size policy add it to each of the tabs in the toolbox. Then add your widgets to the custom pages under each tab...

          I just tried and it works. The toolbox had a preferred size policy was enclosed in a scrollarea (expanding size policy)

          1 Reply Last reply
          0
          • W Offline
            W Offline
            webmaster.skelton
            wrote on last edited by
            #5

            Ok thank you. I figured I would have to do something similar to that, but before i did i wanted to make sure there was not an implicit way of doing it.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nickjwallin
              wrote on last edited by
              #6

              In case anybody stumbles upon this, I found that to set the minimum size of the tab, you can hack it a bit by setting the minimum height of the grandparent (parent's parent) widget of the widget you insert/add to the QToolBox. Basically, like this:

              @CustomWidget* custom = new CustomWidget();
              toolBox->insertItem(0, custom, "Tab Title");
              custom->setParentMinimumHeight(400); // 400 is an example@

              Where CustomWidget::setParentMinimumHeight(int) is something like:

              @void CustomWidget::setParentMinimumHeight(int height)
              {
              QWidget* parent = this->parentWidget();
              if (parent)
              {
              QWidget* gparent = parent->parentWidget();
              if (gparent)
              {
              gparent->setMinimumHeight(height);
              }
              }
              }@

              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