How to traverse QCheckBox in QGridLayout in qt5

multiple checkbox have been added to one gridlayout.
how to traverse all box under layout and modify state?
there is no response using the following methods

QLayout *layout = ui->gridLayout->layout();
  

foreach(QObject *obj, layout->children())
{
     QCheckBox *chkbox = qobject_cast<QCheckBox *>(obj);
     qDebug()<<"name:"<<chkbox->objectName();
 }
Qt5
Apr.12,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a3aa-2c20e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a3aa-2c20e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?