How does QT traverse all the controls on UI in its own class?

void PLC::SearchControl()
{
    QObjectList list =children() ;
    qDebug() << list.length()  << endl;
    QPushButton *b;
    foreach (QObject *obj, list)
    {
        b = qobject_cast<QPushButton*>(obj);
        if(b)
        {
            PushButtonStr.append( b->text());
            qDebug() << b->text() << endl;
        }
    }
}

I wrote in the PLC class to find all the QPushButton controls. I put five buttons on the UI. The children (), in PLC can not find the controls on the UI. The code is placed in the widget class and can be found successfully. The running result is shown in figure

.
Nov.05,2021
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-1b355ee-2b7d5.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-1b355ee-2b7d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?