I have a QToolBox which has a page, which has a QWidget and the QWidget has a QLabel. How can I access the QLabel only with direct access to the QToolBox?
QToolBox* toolBox = new QToolBox;
void insert()
{
QWidget *newWidget = new QWidget;
toolBox->insertItem(newWidget, toolBox->count(), "some text");
QLabel *newLabel = new QLabel;
newLabel->setParent(newWidget);
newLabel->setGeometry(10, 10, 49, 16);
}
I thought I can do toolBox->widget(index)->children().at(0) but the function children() returns the wrong type (I would need QLabel and not QWidget).