0

I want create a Table based on QGridLayout that consist my custom widgets with different amount of columns in each row, for example: http://urls.by/tbl

How i can do it?

When i change widgets width in first row, another rows also change width.

1 Answers1

0

The format of adding a widget or layout to your QGridLayout is as follows:

myGridLayout->addWidget( QWidget*, row, column, rowspan, columnspan );
myGridLayout->addLayout( QLayout*, row, column, rowspan, columnspan );

You can put your rowspan and columnspan as required by you. For example, if you want the widget to span 4 columns, you just need to put 4 in the required field.

EDIT: Ofcourse there are other optional fields for alignment etc but I haven't mentioned those in the above format.

EDIT 2: So what I understand is that you want to be able to insert or magnify cells in any row and the rest of the cells should shift accordingly.

In that case I think a QHBoxLayout for each row would be more suitable. You can then align these QHBoxLayouts in a single QVBoxLayout

Abhishek Bansal
  • 12,589
  • 4
  • 31
  • 46