You cannot use findChildren() on a layout. You need to call QLayout::count() and QLayout::itemAt() to access its (child) items.
void enableContainedWidgets(QLayout* layout, bool enable) {
for (int i = 0; i < layout->count(); i++)
if (auto w = layout->itemAt(i)->widget())
w->setEnabled(enable);
};