Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make contents of a tab widget in Qt automatically resize?

I'm trying to create a form with a nested Tab Widget in Qt Creator. The tree diagram of the contents looks like:

http://i.imgur.com/NBSDPsR.png

The tab widget itself resizes in accordance with the size of the parent window, which is good. What I want, though, is for the contents of the tabs - such as that graphicsView - to resize in accordance to the size of the tab which is modified by the size of the parent window. It doesn't in this configuration, and adding intermediary containers inside the tab doesn't appear to solve the issue.

I notice that the layout icons at the tabs seem to indicate that it's disabled. Why?

like image 562
Abu Dhabi Avatar asked Feb 02 '14 13:02

Abu Dhabi


1 Answers

You need to create some layout for your tabs (in case of single widget it doesn't matter which) to change layout for tabs of QTabWidget you just need to select desired tab in designer (and I mean selecting current tab visually on the form not in object inspector) and press button for desired layout at the top toolbar. I hope it would solve the problem.

like image 71
Predelnik Avatar answered Oct 14 '22 00:10

Predelnik