hello community, i have a QGridLayout who i fill with some custom widget.

1- the first time i fill it i ask the hight and the answer is the right one, and is shown as i specked with these function, no problem at all.

Qt Code:
  1. this->yearLayout->getGrid()->sizeHint().height();
To copy to clipboard, switch view to plain text mode 

2- then i erase the content of the gridlayout these way:

Qt Code:
  1. while(this->pictureLayout->count() > 0)
  2. {
  3. QWidget* widget = this->pictureLayout->itemAt(0)->widget();
  4. this->pictureLayout->removeWidget( widget );
  5. delete widget;
  6. }
To copy to clipboard, switch view to plain text mode 

3-if i fill again the grid with the same function of step 1 and ask the hight the answer is always "18" but the grid is shown as i specked with all the widget on every cell.
4- Never again i get the right hight value, just the first time i fill my grid.

i don´t know if is something these cleaning function do or if it set the grid to do something i don´t want. These way is cleaned perfect but i can´t ever get the height no more, and is what i want.

if any one can help me i will appreciate it.

hugs