• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

line up items and stretch in a Qt frid

I have 4 pairs of items.  4 labels and 4 combo boxes that go with the associated label.  For concreteness, call the items:

NW (for northwest)
NE (for northeast)
SW (for southwest)
SE (for southeast)

The problems I have are:

1) I would like to use a grid to horizontally line up the combo boxes for NW and SW (as well as NE with SE)
2) Instead of a grid, I want to use horizontal layout boxes so I can use a stretch

So: how to I get things to stretch when I put them on a grid?
1 Solution
Use QGridLayout::setColumnStretch(int column, int stretch)

QGridLayout *g = new QGridLayout();
g->setColumnStretch(0, 1);
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now