[Qt-interest] Hiding rows and columns of buttons in a grid layout - segfault
Camilo Polymeris
cpolymeris at gmail.com
Wed Sep 22 03:50:03 CEST 2010
> Either Qt is buggy (unlikely as valgrind is hosted by KDE, who use Qt, and KDE has been run under valgrind),
> or you are passing bad pointers into Qt.
>
> Could you increase the stack depth, and see if that gives you any clues as to what is going on?
>
>
Stack depth 50: http://pastebin.com/LdiZ8zjN
Got it to work by copying the list before entering the for loop. Could
it be that the list gets reordered or somehow changed when changing
button visibility?
void MainWindow::setButtonGroupVisible(const QButtonGroup * bg, bool visible)
{
assert(bg);
assert(bg->buttons().size() > 0);
QList<QAbstractButton *> list = bg->buttons();
for (QList<QAbstractButton *>::iterator it = list.begin();
it != list.end(); ++it)
(*it)->setVisible(visible);
}
I am not sure this is the best approach to what I want to do, anyway.
Maybe I should try modifing the contatining grid layout, instead.
Thanks for your help,
Camilo
More information about the Qt-interest-old
mailing list