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.
this->yearLayout->getGrid()->sizeHint().height();
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:
while(this->pictureLayout->count() > 0)
{
QWidget* widget
= this
->pictureLayout
->itemAt
(0)->widget
();
this->pictureLayout->removeWidget( widget );
delete widget;
}
while(this->pictureLayout->count() > 0)
{
QWidget* widget = this->pictureLayout->itemAt(0)->widget();
this->pictureLayout->removeWidget( widget );
delete widget;
}
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
Bookmarks