quimnuss
18th March 2016, 13:25
Does layout->children() not include QWidgets added with addWidget?
QWidget* wid = new QWidget();
formLayout->addWidget(wid);
QList<QObject*> blah = formLayout->children();
qDebug() << blah << " - blah - " << blah.size();
Size is 0 and blah is empty.
However, its parent childern does include the added widget. So ->addWidget() doesn't set the layout as parent but the layout's parent? Are layouts then assumed to never be parents?
How can I add QWidgets to a layout so that I can use findChild by its name?
Cheers
QWidget* wid = new QWidget();
formLayout->addWidget(wid);
QList<QObject*> blah = formLayout->children();
qDebug() << blah << " - blah - " << blah.size();
Size is 0 and blah is empty.
However, its parent childern does include the added widget. So ->addWidget() doesn't set the layout as parent but the layout's parent? Are layouts then assumed to never be parents?
How can I add QWidgets to a layout so that I can use findChild by its name?
Cheers