line up items and stretch in a Qt frid

Posted on 2007-10-08
Last Modified: 2013-11-23
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?
Question by:dwcronin
    1 Comment
    LVL 15

    Accepted Solution

    Use QGridLayout::setColumnStretch(int column, int stretch)

    QGridLayout *g = new QGridLayout();
    g->setColumnStretch(0, 1);

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deletiā€¦
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now