QScrollArea hates QTabWidget ?
-
Hello,
Sorry if this is dupe, I searched and while I found a bunch of (old) threads nothing that seemed to be the same problem.
Basically I have a QTabWidget that has about 7 tabs.
I'm trying to put the tab widget inside a scroll area.
My goal is to have the scroll area resize itself and contents so that the tab
widget fits and there is no horizontal scrolling needed.But whatever I do when I remove horizontal scrolling the scroll area will figure out a size where the tab widget will be clipped horizontally. Even the little buttons to move to a different tab won't appear.
Is there a right way to do this?
My QScrollArea has Preferred, Preferred size policy, No horizontal scroll bars. Resize widgets is enabled.
I tried the tab widget with Preferred, Preferred, Minimum,Maximum etc and none seems to work....
Thanks for any tips!
-
Hello,
Sorry if this is dupe, I searched and while I found a bunch of (old) threads nothing that seemed to be the same problem.
Basically I have a QTabWidget that has about 7 tabs.
I'm trying to put the tab widget inside a scroll area.
My goal is to have the scroll area resize itself and contents so that the tab
widget fits and there is no horizontal scrolling needed.But whatever I do when I remove horizontal scrolling the scroll area will figure out a size where the tab widget will be clipped horizontally. Even the little buttons to move to a different tab won't appear.
Is there a right way to do this?
My QScrollArea has Preferred, Preferred size policy, No horizontal scroll bars. Resize widgets is enabled.
I tried the tab widget with Preferred, Preferred, Minimum,Maximum etc and none seems to work....
Thanks for any tips!
This is how everything looks in the Qt Designer

This is the reality when using 'Expanding' size policy on the scroll area.

Finally this is the reality when using 'Preferred' size policy on the scroll area.

The result that I get in designer is what I'd like in reality.
The wildly expanding one is the only way I can make it not clip but it's really just not usable as such.
And the clipping one is not usable because sideways scrolling really sucks. (in general)
Why is this such a PITA? This is about 180 from WYSIWYG and is an overall garbage dev UX.
-
Hi,
If memory serves well, for that kind of thing to happen, you need to trigger a resize of your QScrollArea when you switch widgets so it can resize the way you want it.
-
Hi,
If memory serves well, for that kind of thing to happen, you need to trigger a resize of your QScrollArea when you switch widgets so it can resize the way you want it.
-
When you change tab.
-
-

Things in the middle getting squished, I have no idea why. The vertical size policy is preferred.
The list widget at the top is set to minimumExpanding.
The bottom most groupbox has also preferred vertical size policy. But this isn't getting squished.
why.....