uniquenamehere
uniquenamehere

Reputation: 1949

Align items to left in a horizontal layout in Qt

I have a horizontal layout that contains QLabels. These QLabels are actually icons and I want to left align them in the horizontal layout. The problem is that they are centered no matter what I do. I try to select them all with horizontal left alignment, but they are still centered. I am trying this in Qt Creator under the design page.

Is this expected behavior? Any suggestions on how to get this work?

Upvotes: 11

Views: 6561

Answers (1)

Pavel Strakhov
Pavel Strakhov

Reputation: 40492

You should add a horizontal spacer to the layout. Horizontal spacer is available in the left column of Designer, under "Spacers" section.

Upvotes: 14

Related Questions