[Qt-interest] Get children from layout

Alex Ivasyuv industral at gmail.com
Sun Oct 31 20:56:35 CET 2010


Hi,

I try to hide all widgets in layout. But looks like findChildren doesn't 
work for layout.

here's my sample code:

         QLayout * layout = widget -> findChild<QLayout *> (layoutName);
         QList<QWidget *> list = layout -> findChildren<QWidget *> ();

         cout << list.size() << endl;

size is 0, but inside this layout I have a few widgets.
But the same code works fine if I try to get widgets from parent widget.

How I can get them from appropriate layout?

Thanks,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101031/a90baa7a/attachment.html 


More information about the Qt-interest-old mailing list