Merge item in QGridLayout
-
Recently I'm working with QGridLayout. I want when I select 2 or 4 items in GridLayout, those 4 items will be merged together into 1 large item. Take a look at the photo below, these are images from another application, I want to get the same result:
After i press Joint button:
Then I got grid like this:
I can get the row-col of the selected item, but I don't know how to merge the selected items into one large item and redraw the grid. Help me please
-
@Hai-Anh-Luu
"Merging" must be achieved by spanning rows and/or columns.
void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment = Qt::Alignment())
and similar allow this when placing an item. I do not see a method to alter the spanning once an item has been added.