PDA

View Full Version : Immediatly stretching Widgets



unsortedTable
29th January 2019, 12:37
Hi,
I have a QHBoxLayout with a QTableWidget and a thin Button, with the purpose to show additional informations.
These informations (currently Placeholder LineEdits and Buttons) are in a QGridLayout together with the thinButton. Then I setStretch(0,3) and setStretch(1,1) on my QHBoxLayout. This works pretty well and i get the wanted sizes for my Table and the GridLayout.
Then i call a method to update the TableHeaders to space them better in the smaller space. But somehow the Table->width() is not yet updated and therefore the headers won't get resized correctly.

Can i do something to immediatly stretch the components of my QHBoxLayout? Or do i need to try an ugly workaround by gathering the individual stretch factors and calculate the new width myself before the width is changed?
I'd really appreciate it if someone would help me. And even if not, I'd also like you to have a great day.

tuli
29th January 2019, 18:30
Not sure i 100% understand your problem, but isnt it enough to just call update() on the layouts in question?