(SOLVED) Any way to get how many widgets are in an QVBoxLayout?
-
@jjan You can use itemAt to get the
QLayoutItem
at particular index and use widget to get the widget it contains. Then as usual you can useobjectName
to get the name of it. Eg:ui->verticalLayout->itemAt(1)->widget()->objectName(); //will give name of widget at index 1 //verticalLayout = QVBoxLayout
-
@jjan You can use itemAt to get the
QLayoutItem
at particular index and use widget to get the widget it contains. Then as usual you can useobjectName
to get the name of it. Eg:ui->verticalLayout->itemAt(1)->widget()->objectName(); //will give name of widget at index 1 //verticalLayout = QVBoxLayout