TimSch
TimSch

Reputation: 1462

Set child elements of QFrame to same size like the QFrame

I'm just getting familiar with qt.

My goal is to have a main window with two tabbed widgets. The content of these tabs should be separated into own .ui files.

I tried to solve this by adding a new ui file based on a QFrame.
Inside the QFrame I put a QVBoxLayout and in that QVBoxLayout I added a table.

In the end it looked like this:
enter image description here

I suppose everything to be the same size. The table view should fit into the VBox and the VBox should expand to the QFrame.

Instead it looks like this (i added a background color to each element):
enter image description here

The table view has the same size like the VBox (green). But it's smaller than the QFrame.

These are the properties of the QFrame:
enter image description here

These are the properties of the QVBoxLayout:
enter image description here

I omit the properties of the QTableView because it has already the correct size (same as parent).
What can I do to expand the QVBoxLayout to the QFrame?

Upvotes: 0

Views: 21

Answers (0)

Related Questions