[Qt-interest] I want buttons in 3 rows

Tom Panning lurchvt at gmail.com
Tue May 5 14:28:30 CEST 2009


On Tue, May 5, 2009 at 5:37 AM, Sai Chandra <Sai.Chandra at lntinfotech.com> wrote:
>
> hi ,
>   I am desigining an application where i am dispaying the buttons on
> QHBoxLayout. I have 9 buttons but only few buttons are getting displayed in
> one row. where as i want them in 3 rows at 3 buttons in a row. How do i get
> it on QHBoxlayout???
>

Create a QVBoxLayout and add three QHBoxLayouts, then add three
buttons to each of the QHBoxLayouts.

This will create three rows, each containing three buttons, but the
buttons from one row are not guaranteed to line up vertically with the
buttons above/below them. If you want them to line up vertically, use
a QGridLayout with three rows and three columns.

Tom




More information about the Qt-interest-old mailing list